Author: bodewig Date: Wed Apr 15 09:38:47 2009 New Revision: 765095 URL: http://svn.apache.org/viewvc?rev=765095&view=rev Log: document default encoding in ASi extra field
Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java?rev=765095&r1=765094&r2=765095&view=diff ============================================================================== --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java Wed Apr 15 09:38:47 2009 @@ -45,6 +45,10 @@ * <p>Short is two bytes and Long is four bytes in big endian byte and * word order, device numbers are currently not supported.</p> * @NotThreadSafe + * + * <p>Since the documentation this class is based upon doesn't mention + * the character encoding of the file name at all, it is assumed that + * it uses the current platform's default encoding.</p> */ public class AsiExtraField implements ZipExtraField, UnixStat, Cloneable { @@ -101,7 +105,7 @@ + WORD // SizDev + 2 // UID + 2 // GID - + getLinkedFile().getBytes().length); // TODO is it correct to use the default charset here? + + getLinkedFile().getBytes().length); } /** @@ -122,7 +126,7 @@ byte[] data = new byte[getLocalFileDataLength().getValue() - WORD]; System.arraycopy(ZipShort.getBytes(getMode()), 0, data, 0, 2); - byte[] linkArray = getLinkedFile().getBytes(); // TODO is it correct to use the default charset here? + byte[] linkArray = getLinkedFile().getBytes(); // CheckStyle:MagicNumber OFF System.arraycopy(ZipLong.getBytes(linkArray.length), 0, data, 2, WORD); @@ -280,7 +284,7 @@ link = ""; } else { System.arraycopy(tmp, 10, linkArray, 0, linkArray.length); - link = new String(linkArray); // TODO is it correct to use the default charset here? + link = new String(linkArray); } // CheckStyle:MagicNumber ON setDirectory((newMode & DIR_FLAG) != 0);