|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.sconman.helpers.FileHelper
public class FileHelper
Helper methods for contents in files and directories.
Nested Class Summary | |
---|---|
static interface |
FileHelper.IFileVisitor
Interface for visitor pattern |
Constructor Summary | |
---|---|
FileHelper()
|
Method Summary | |
---|---|
static void |
delete(java.io.File f)
Deletes a directory and subdirectories |
static java.lang.String |
getDirPath(java.lang.String path)
Returns the content's dir path, relative to the filestore |
static java.lang.String |
getExtension(java.lang.String fileName)
Returns the file's extension (substring from last '.') |
static java.lang.String |
getFileName(java.lang.String path)
Returns the file id |
static java.lang.String |
getFileNameWithoutExt(java.lang.String filePath)
|
static java.lang.String |
getRelativePath(java.lang.String root,
java.lang.String path)
Returns the relative path from root to path. |
static void |
visitFiles(java.io.File file,
FileHelper.IFileVisitor fv)
Visitor pattern implementation for File objects. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileHelper()
Method Detail |
---|
public static void visitFiles(java.io.File file, FileHelper.IFileVisitor fv)
file
- The starting point for the visitfv
- The Visitor who wants to explore the file treepublic static void delete(java.io.File f)
f
- public static java.lang.String getExtension(java.lang.String fileName)
fileName
- The file
public static java.lang.String getFileName(java.lang.String path)
path
- The file path
public static java.lang.String getDirPath(java.lang.String path)
content
-
public static java.lang.String getFileNameWithoutExt(java.lang.String filePath)
filePath
-
public static java.lang.String getRelativePath(java.lang.String root, java.lang.String path) throws java.io.IOException
root
- path
-
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |