|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.lingala.zip4j.util.Zip4jUtil
public class Zip4jUtil
Constructor Summary | |
---|---|
Zip4jUtil()
|
Method Summary | |
---|---|
static boolean |
checkArrayListTypes(ArrayList sourceList,
int type)
Checks to see if all the elements in the arraylist match the given type |
static boolean |
checkFileExists(File file)
|
static boolean |
checkFileExists(String path)
|
static boolean |
checkFileReadAccess(String path)
|
static boolean |
checkFileWriteAccess(String path)
|
static boolean |
checkOutputFolder(String path)
|
static byte[] |
convertCharset(String str)
|
static String |
decodeFileName(byte[] data,
boolean isUTF8)
Decodes file name based on encoding. |
static String |
detectCharSet(String str)
Detects the encoding charset for the input string |
static long |
dosToJavaTme(int dosTime)
Converts time in dos format to Java format |
static String |
getAbsoluteFilePath(String filePath)
Returns an absoulte path for the given file path |
static long[] |
getAllHeaderSignatures()
|
static String |
getCp850EncodedString(byte[] data)
Returns a string in Cp850 encoding from the input bytes. |
static int |
getEncodedStringLength(String str)
returns the length of the string by wrapping it in a byte buffer with the appropriate charset of the input string and returns the limit of the byte buffer |
static int |
getEncodedStringLength(String str,
String charset)
returns the length of the string in the input encoding |
static FileHeader |
getFileHeader(ZipModel zipModel,
String fileName)
|
static FileHeader |
getFileHeaderWithExactMatch(ZipModel zipModel,
String fileName)
|
static long |
getFileLengh(File file)
|
static long |
getFileLengh(String file)
|
static String |
getFileNameFromFilePath(File file)
|
static ArrayList |
getFilesInDirectoryRec(File path,
boolean readHiddenFiles)
|
static int |
getIndexOfFileHeader(ZipModel zipModel,
FileHeader fileHeader)
|
static long |
getLastModifiedFileTime(File file,
TimeZone timeZone)
|
static String |
getRelativeFileName(String file,
String rootFolderInZip,
String rootFolderPath)
|
static ArrayList |
getSplitZipFiles(ZipModel zipModel)
|
static String |
getZipFileNameWithoutExt(String zipFile)
|
static boolean |
isStringNotNullAndNotEmpty(String str)
|
static boolean |
isSupportedCharset(String charset)
Checks if the input charset is supported |
static boolean |
isWindows()
|
static long |
javaToDosTime(long time)
Converts input time from Java to DOS format |
static void |
setFileArchive(File file)
|
static void |
setFileHidden(File file)
|
static void |
setFileReadOnly(File file)
|
static void |
setFileSystemMode(File file)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Zip4jUtil()
Method Detail |
---|
public static boolean isStringNotNullAndNotEmpty(String str)
public static boolean checkOutputFolder(String path) throws ZipException
ZipException
public static boolean checkFileReadAccess(String path) throws ZipException
ZipException
public static boolean checkFileWriteAccess(String path) throws ZipException
ZipException
public static boolean checkFileExists(String path) throws ZipException
ZipException
public static boolean checkFileExists(File file) throws ZipException
ZipException
public static boolean isWindows()
public static void setFileReadOnly(File file) throws ZipException
ZipException
public static void setFileHidden(File file) throws ZipException
ZipException
public static void setFileArchive(File file) throws ZipException
ZipException
public static void setFileSystemMode(File file) throws ZipException
ZipException
public static long getLastModifiedFileTime(File file, TimeZone timeZone) throws ZipException
ZipException
public static String getFileNameFromFilePath(File file) throws ZipException
ZipException
public static long getFileLengh(String file) throws ZipException
ZipException
public static long getFileLengh(File file) throws ZipException
ZipException
public static long javaToDosTime(long time)
time
-
public static long dosToJavaTme(int dosTime)
dosTime
-
public static FileHeader getFileHeader(ZipModel zipModel, String fileName) throws ZipException
ZipException
public static FileHeader getFileHeaderWithExactMatch(ZipModel zipModel, String fileName) throws ZipException
ZipException
public static int getIndexOfFileHeader(ZipModel zipModel, FileHeader fileHeader) throws ZipException
ZipException
public static ArrayList getFilesInDirectoryRec(File path, boolean readHiddenFiles) throws ZipException
ZipException
public static String getZipFileNameWithoutExt(String zipFile) throws ZipException
ZipException
public static byte[] convertCharset(String str) throws ZipException
ZipException
public static String decodeFileName(byte[] data, boolean isUTF8)
data
- isUTF8
-
public static String getCp850EncodedString(byte[] data)
data
-
public static String getAbsoluteFilePath(String filePath) throws ZipException
filePath
-
ZipException
public static boolean checkArrayListTypes(ArrayList sourceList, int type) throws ZipException
sourceList
- - list to be checkedtype
- - type of elements to be present in the list (ex: File, String, etc)
ZipException
public static String detectCharSet(String str) throws ZipException
str
-
ZipException
- - if input string is null. In case of any other exception
this method returns default System charsetpublic static int getEncodedStringLength(String str) throws ZipException
str
-
ZipException
public static int getEncodedStringLength(String str, String charset) throws ZipException
str
- charset
-
ZipException
public static boolean isSupportedCharset(String charset) throws ZipException
charset
-
ZipException
public static ArrayList getSplitZipFiles(ZipModel zipModel) throws ZipException
ZipException
public static String getRelativeFileName(String file, String rootFolderInZip, String rootFolderPath) throws ZipException
ZipException
public static long[] getAllHeaderSignatures()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |