Package org.jgroups.blocks
Class GridFile
- java.lang.Object
-
- java.io.File
-
- org.jgroups.blocks.GridFile
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<java.io.File>
public class GridFile extends java.io.FileSubclass of File to iterate through directories and files in a grid- Author:
- Bela Ban
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGridFile.Metadata
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String[]_list(java.lang.Object filter)protected java.io.File[]_listFiles(java.lang.Object filter)protected booleancheckParentDirs(java.lang.String path, boolean create_if_absent)Checks whether the parent directories are present (and are directories).booleancreateNewFile()booleandelete()booleandelete(boolean synchronous)booleanexists()protected static java.lang.Stringfilename(java.lang.String full_path)intgetChunkSize()java.lang.StringgetName()java.lang.StringgetPath()protected voidinitMetadata()protected static booleanisChildOf(java.lang.String parent, java.lang.String child)Verifies whether child is a child (dir or file) of parentbooleanisDirectory()booleanisFile()longlength()java.lang.String[]list()java.lang.String[]list(java.io.FilenameFilter filter)java.io.File[]listFiles()java.io.File[]listFiles(java.io.FileFilter filter)java.io.File[]listFiles(java.io.FilenameFilter filter)booleanmkdir()booleanmkdirs()protected static java.lang.Stringtrim(java.lang.String str)-
Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createTempFile, createTempFile, deleteOnExit, equals, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getParent, getParentFile, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isHidden, lastModified, listRoots, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
- Overrides:
getNamein classjava.io.File
-
getPath
public java.lang.String getPath()
- Overrides:
getPathin classjava.io.File
-
length
public long length()
- Overrides:
lengthin classjava.io.File
-
getChunkSize
public int getChunkSize()
-
createNewFile
public boolean createNewFile() throws java.io.IOException- Overrides:
createNewFilein classjava.io.File- Throws:
java.io.IOException
-
delete
public boolean delete()
- Overrides:
deletein classjava.io.File
-
delete
public boolean delete(boolean synchronous)
-
mkdir
public boolean mkdir()
- Overrides:
mkdirin classjava.io.File
-
mkdirs
public boolean mkdirs()
- Overrides:
mkdirsin classjava.io.File
-
exists
public boolean exists()
- Overrides:
existsin classjava.io.File
-
list
public java.lang.String[] list()
- Overrides:
listin classjava.io.File
-
list
public java.lang.String[] list(java.io.FilenameFilter filter)
- Overrides:
listin classjava.io.File
-
listFiles
public java.io.File[] listFiles()
- Overrides:
listFilesin classjava.io.File
-
listFiles
public java.io.File[] listFiles(java.io.FilenameFilter filter)
- Overrides:
listFilesin classjava.io.File
-
listFiles
public java.io.File[] listFiles(java.io.FileFilter filter)
- Overrides:
listFilesin classjava.io.File
-
isDirectory
public boolean isDirectory()
- Overrides:
isDirectoryin classjava.io.File
-
isFile
public boolean isFile()
- Overrides:
isFilein classjava.io.File
-
initMetadata
protected void initMetadata()
-
_listFiles
protected java.io.File[] _listFiles(java.lang.Object filter)
-
_list
protected java.lang.String[] _list(java.lang.Object filter)
-
isChildOf
protected static boolean isChildOf(java.lang.String parent, java.lang.String child)Verifies whether child is a child (dir or file) of parent- Parameters:
parent-child-- Returns:
- True if child is a child, false otherwise
-
filename
protected static java.lang.String filename(java.lang.String full_path)
-
checkParentDirs
protected boolean checkParentDirs(java.lang.String path, boolean create_if_absent) throws java.io.IOExceptionChecks whether the parent directories are present (and are directories). If create_if_absent is true, creates missing dirs- Parameters:
path-create_if_absent-- Returns:
- Throws:
java.io.IOException
-
trim
protected static java.lang.String trim(java.lang.String str)
-
-