|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.compress.compressors.FileNameUtil
public class FileNameUtil
File name mapping code for the compression formats.
Constructor Summary | |
---|---|
FileNameUtil(Map<String,String> uncompressSuffix,
String defaultExtension)
sets up the utility with a map of known compressed to uncompressed suffix mappings and the default extension of the format. |
Method Summary | |
---|---|
String |
getCompressedFilename(String filename)
Maps the given filename to the name that the file should have after compressio. |
String |
getUncompressedFilename(String filename)
Maps the given name of a compressed file to the name that the file should have after uncompression. |
boolean |
isCompressedFilename(String filename)
Detects common format suffixes in the given filename. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileNameUtil(Map<String,String> uncompressSuffix, String defaultExtension)
uncompressSuffix
- Map from common filename suffixes of
compressed files to the corresponding suffixes of uncompressed
files. For example: from ".tgz" to ".tar". This map also
contains format-specific suffixes like ".gz" and "-z". These
suffixes are mapped to the empty string, as they should simply
be removed from the filename when the file is uncompressed.defaultExtension
- the format's default extension like ".gz"Method Detail |
---|
public boolean isCompressedFilename(String filename)
filename
- name of a file
true
if the filename has a common format suffix,
false
otherwisepublic String getUncompressedFilename(String filename)
filename
- name of a file
public String getCompressedFilename(String filename)
filename
- name of a file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |