|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jac.util.Files
Various often used file functions
Field Summary | |
static FileFilter |
directoryFilter
A filter to list only directories |
static FileFilter |
nonHiddenFilter
A filter to list only non hidden files |
Constructor Summary | |
Files()
|
Method Summary | |
static Reader |
autoDecompressReader(File f,
String encoding)
Returns a reader or a file. |
static InputStream |
autoDecompressStream(File f)
Returns an input stream or a file. |
static String |
expandFileName(String path)
Replaces leading ~ by the user's home directory |
static FilenameFilter |
extensionFilenamFilter(String extension)
Creates a FilenameFilter which matches files whose name end with a particular extension |
static File[] |
listDirectories(File dir)
|
static File[] |
listNonHiddenFiles(File dir)
|
static Writer |
newFileWriter(File f,
String encoding)
Creates a writer for a file with a specific encoding |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final FileFilter directoryFilter
public static final FileFilter nonHiddenFilter
Constructor Detail |
public Files()
Method Detail |
public static InputStream autoDecompressStream(File f) throws FileNotFoundException, IOException
f
- the file to get an input stream for
FileNotFoundException
IOException
public static Reader autoDecompressReader(File f, String encoding) throws FileNotFoundException, IOException
f
- the file to get an input stream forencoding
- charset encoding to use for the Reader
FileNotFoundException
IOException
public static Writer newFileWriter(File f, String encoding) throws FileNotFoundException, UnsupportedEncodingException
f
- the file to create a writer forencoding
- the encoding of the file
FileNotFoundException
UnsupportedEncodingException
public static FilenameFilter extensionFilenamFilter(String extension)
extension
- the extension
public static String expandFileName(String path)
path
- file path to expandpublic static File[] listDirectories(File dir)
public static File[] listNonHiddenFiles(File dir)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |