Package org.jgroups.blocks
Class GridFile
java.lang.Object
java.io.File
org.jgroups.blocks.GridFile
- All Implemented Interfaces:
Serializable,Comparable<File>
Subclass of File to iterate through directories and files in a grid
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ReplCache<String, GridFile.Metadata> private intprivate final GridFilesystemprivate final Stringprivate static final longFields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar -
Constructor Summary
ConstructorsConstructorDescriptionGridFile(File parent, String child, ReplCache<String, GridFile.Metadata> cache, int chunk_size, GridFilesystem fs) GridFile(String parent, String child, ReplCache<String, GridFile.Metadata> cache, int chunk_size, GridFilesystem fs) GridFile(String pathname, ReplCache<String, GridFile.Metadata> cache, int chunk_size, GridFilesystem fs) -
Method Summary
Modifier and TypeMethodDescriptionprotected String[]protected File[]_listFiles(Object filter) protected booleancheckParentDirs(String path, boolean create_if_absent) Checks whether the parent directories are present (and are directories).booleanbooleandelete()booleandelete(boolean synchronous) booleanexists()private booleanprotected static StringintgetName()getPath()protected voidprotected static booleanVerifies whether child is a child (dir or file) of parentbooleanbooleanisFile()private booleanlonglength()String[]list()String[]list(FilenameFilter filter) File[]File[]listFiles(FileFilter filter) File[]listFiles(FilenameFilter filter) booleanmkdir()booleanmkdirs()(package private) voidsetLength(int new_length) protected static StringMethods 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
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
cache
-
fs
-
name
-
chunk_size
private int chunk_size
-
-
Constructor Details
-
GridFile
GridFile(String pathname, ReplCache<String, GridFile.Metadata> cache, int chunk_size, GridFilesystem fs) -
GridFile
GridFile(String parent, String child, ReplCache<String, GridFile.Metadata> cache, int chunk_size, GridFilesystem fs) -
GridFile
GridFile(File parent, String child, ReplCache<String, GridFile.Metadata> cache, int chunk_size, GridFilesystem fs)
-
-
Method Details
-
getName
-
getPath
-
length
public long length() -
setLength
void setLength(int new_length) -
getChunkSize
public int getChunkSize() -
createNewFile
- Overrides:
createNewFilein classFile- Throws:
IOException
-
delete
public boolean delete() -
delete
public boolean delete(boolean synchronous) -
mkdir
public boolean mkdir() -
mkdirs
public boolean mkdirs() -
exists
public boolean exists() -
list
-
list
-
listFiles
-
listFiles
-
listFiles
-
isDirectory
public boolean isDirectory()- Overrides:
isDirectoryin classFile
-
isFile
public boolean isFile() -
initMetadata
protected void initMetadata() -
_listFiles
-
_list
-
isChildOf
Verifies whether child is a child (dir or file) of parent- Parameters:
parent-child-- Returns:
- True if child is a child, false otherwise
-
filename
-
checkParentDirs
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:
IOException
-
trim
-
exists
-
isFile
-