org.infinispan.io
Class GridFile
java.lang.Object
java.io.File
org.infinispan.io.GridFile
- All Implemented Interfaces:
- Serializable, Comparable<File>
public class GridFile
- extends File
Subclass of File to iterate through directories and files in a grid
- Author:
- Bela Ban
- See Also:
- Serialized Form
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, toString, toURI, toURL |
getName
public String getName()
- Overrides:
getName
in class File
getPath
public String getPath()
- Returns path of this file. To avoid issues arising from file separator differences between different
operative systems, the path returned always uses Unix-like path separator, '/' character. Any client
code calling this method should bear that if disecting the path.
- Overrides:
getPath
in class File
- Returns:
- String containing path of file.
length
public long length()
- Overrides:
length
in class File
getChunkSize
public int getChunkSize()
createNewFile
public boolean createNewFile()
throws IOException
- Overrides:
createNewFile
in class File
- Throws:
IOException
delete
public boolean delete()
- Overrides:
delete
in class File
delete
public boolean delete(boolean synchronous)
mkdir
public boolean mkdir()
- Overrides:
mkdir
in class File
mkdirs
public boolean mkdirs()
- Overrides:
mkdirs
in class File
exists
public boolean exists()
- Overrides:
exists
in class File
list
public String[] list()
- Overrides:
list
in class File
list
public String[] list(FilenameFilter filter)
- Overrides:
list
in class File
listFiles
public File[] listFiles()
- Overrides:
listFiles
in class File
listFiles
public File[] listFiles(FilenameFilter filter)
- Overrides:
listFiles
in class File
listFiles
public File[] listFiles(FileFilter filter)
- Overrides:
listFiles
in class File
isDirectory
public boolean isDirectory()
- Overrides:
isDirectory
in class File
isFile
public boolean isFile()
- Overrides:
isFile
in class File
initMetadata
protected void initMetadata()
_listFiles
protected File[] _listFiles(Object filter)
_list
protected String[] _list(Object filter)
isChildOf
protected static boolean isChildOf(String parent,
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 String filename(String full_path)
checkParentDirs
protected boolean checkParentDirs(String path,
boolean create_if_absent)
throws 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:
IOException
trim
protected static String trim(String str)
Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.