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, Marko Luksa
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 createIfAbsent)
          Checks whether the parent directories are present (and are directories).
 int compareTo(File file)
           
 boolean createNewFile()
           
 boolean delete()
           
 boolean delete(boolean synchronous)
           
 boolean equals(Object obj)
           
 boolean exists()
           
protected static String filename(String fullPath)
           
 File getAbsoluteFile()
           
 String getAbsolutePath()
           
 int getChunkSize()
           
 String getName()
           
 String getParent()
           
 File getParentFile()
           
 String getPath()
          Returns path of this file.
 int hashCode()
           
protected  void initChunkSizeFromMetadata()
           
 boolean isAbsolute()
           
protected static boolean isChildOf(String parent, String child)
          Verifies whether child is a child (dir or file) of parent
 boolean isDirectory()
           
 boolean isFile()
           
 long lastModified()
           
 long length()
           
 String[] list()
           
 String[] list(FilenameFilter filter)
           
 File[] listFiles()
           
 File[] listFiles(FileFilter filter)
           
 File[] listFiles(FilenameFilter filter)
           
 boolean mkdir()
           
 boolean mkdirs()
           
 
Methods inherited from class java.io.File
canExecute, canRead, canWrite, createTempFile, createTempFile, deleteOnExit, getCanonicalFile, getCanonicalPath, getFreeSpace, getTotalSpace, getUsableSpace, isHidden, 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.

getAbsolutePath

public String getAbsolutePath()
Overrides:
getAbsolutePath in class File

getAbsoluteFile

public File getAbsoluteFile()
Overrides:
getAbsoluteFile in class File

isAbsolute

public boolean isAbsolute()
Overrides:
isAbsolute in class 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

getParent

public String getParent()
Overrides:
getParent in class File

getParentFile

public File getParentFile()
Overrides:
getParentFile in class File

lastModified

public long lastModified()
Overrides:
lastModified 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

initChunkSizeFromMetadata

protected void initChunkSizeFromMetadata()

_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 fullPath)

checkParentDirs

protected boolean checkParentDirs(String path,
                                  boolean createIfAbsent)
                           throws IOException
Checks whether the parent directories are present (and are directories). If createIfAbsent is true, creates missing dirs

Parameters:
path -
createIfAbsent -
Returns:
Throws:
IOException

equals

public boolean equals(Object obj)
Overrides:
equals in class File

compareTo

public int compareTo(File file)
Specified by:
compareTo in interface Comparable<File>
Overrides:
compareTo in class File

hashCode

public int hashCode()
Overrides:
hashCode in class File

-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.