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.File
Subclass 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 class
GridFile.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 boolean
checkParentDirs(java.lang.String path, boolean create_if_absent)
Checks whether the parent directories are present (and are directories).boolean
createNewFile()
boolean
delete()
boolean
delete(boolean synchronous)
boolean
exists()
protected static java.lang.String
filename(java.lang.String full_path)
int
getChunkSize()
java.lang.String
getName()
java.lang.String
getPath()
protected void
initMetadata()
protected static boolean
isChildOf(java.lang.String parent, java.lang.String child)
Verifies whether child is a child (dir or file) of parentboolean
isDirectory()
boolean
isFile()
long
length()
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)
boolean
mkdir()
boolean
mkdirs()
protected static java.lang.String
trim(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:
getName
in classjava.io.File
-
getPath
public java.lang.String getPath()
- Overrides:
getPath
in classjava.io.File
-
length
public long length()
- Overrides:
length
in classjava.io.File
-
getChunkSize
public int getChunkSize()
-
createNewFile
public boolean createNewFile() throws java.io.IOException
- Overrides:
createNewFile
in classjava.io.File
- Throws:
java.io.IOException
-
delete
public boolean delete()
- Overrides:
delete
in classjava.io.File
-
delete
public boolean delete(boolean synchronous)
-
mkdir
public boolean mkdir()
- Overrides:
mkdir
in classjava.io.File
-
mkdirs
public boolean mkdirs()
- Overrides:
mkdirs
in classjava.io.File
-
exists
public boolean exists()
- Overrides:
exists
in classjava.io.File
-
list
public java.lang.String[] list()
- Overrides:
list
in classjava.io.File
-
list
public java.lang.String[] list(java.io.FilenameFilter filter)
- Overrides:
list
in classjava.io.File
-
listFiles
public java.io.File[] listFiles()
- Overrides:
listFiles
in classjava.io.File
-
listFiles
public java.io.File[] listFiles(java.io.FilenameFilter filter)
- Overrides:
listFiles
in classjava.io.File
-
listFiles
public java.io.File[] listFiles(java.io.FileFilter filter)
- Overrides:
listFiles
in classjava.io.File
-
isDirectory
public boolean isDirectory()
- Overrides:
isDirectory
in classjava.io.File
-
isFile
public boolean isFile()
- Overrides:
isFile
in 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.IOException
Checks 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)
-
-