org.infinispan.io
Class GridFile

java.lang.Object
  extended by java.io.File
      extended by 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

Nested Class Summary
static class GridFile.Metadata
           
 
Field Summary
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Method Summary
protected  String[] _list(Object filter)
           
protected  File[] _listFiles(Object filter)
           
protected  boolean checkParentDirs(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 String filename(String full_path)
           
 int getChunkSize()
           
 String getName()
           
 String getPath()
          Returns path of this file.
protected  void initMetadata()
           
protected static boolean isChildOf(String parent, String child)
          Verifies whether child is a child (dir or file) of parent
 boolean isDirectory()
           
 boolean isFile()
           
 long length()
           
 String[] list()
           
 String[] list(FilenameFilter filter)
           
 File[] listFiles()
           
 File[] listFiles(FileFilter filter)
           
 File[] listFiles(FilenameFilter filter)
           
 boolean mkdir()
           
 boolean mkdirs()
           
protected static String trim(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, toString, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

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 © 2011 JBoss, a division of Red Hat. All Rights Reserved.