Infinispan Distribution 5.2.6.Final-redhat-2

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)
           
 boolean canExecute()
           
 boolean canRead()
           
 boolean canWrite()
           
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)
          Deprecated. create GridFilesystem instance with additional FORCE_SYNCHRONOUS flag, if operations should be executed synchronously
 void deleteOnExit()
           
 boolean equals(Object obj)
           
 boolean exists()
           
protected static String filename(String fullPath)
           
 File getAbsoluteFile()
           
 String getAbsolutePath()
           
 File getCanonicalFile()
           
 String getCanonicalPath()
           
 int getChunkSize()
           
 long getFreeSpace()
           
 String getName()
           
 String getParent()
           
 File getParentFile()
           
 String getPath()
          Returns path of this file.
 long getTotalSpace()
           
 long getUsableSpace()
           
 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()
           
 boolean isHidden()
           
 long lastModified()
           
 long length()
           
 String[] list()
           
 String[] list(FilenameFilter filter)
           
 File[] listFiles()
           
 File[] listFiles(FileFilter filter)
           
 File[] listFiles(FilenameFilter filter)
           
 boolean mkdir()
           
 boolean mkdirs()
           
 boolean renameTo(File dest)
           
 boolean setExecutable(boolean executable)
           
 boolean setExecutable(boolean executable, boolean ownerOnly)
           
 boolean setLastModified(long time)
           
 boolean setReadable(boolean readable)
           
 boolean setReadable(boolean readable, boolean ownerOnly)
           
 boolean setReadOnly()
           
 boolean setWritable(boolean writable)
           
 boolean setWritable(boolean writable, boolean ownerOnly)
           
 String toString()
           
 URI toURI()
           
 URL toURL()
           
 
Methods inherited from class java.io.File
createTempFile, createTempFile, listRoots
 
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

getCanonicalPath

public String getCanonicalPath()
                        throws IOException
Overrides:
getCanonicalPath in class File
Throws:
IOException

getCanonicalFile

public File getCanonicalFile()
                      throws IOException
Overrides:
getCanonicalFile in class File
Throws:
IOException

isAbsolute

public boolean isAbsolute()
Overrides:
isAbsolute in class File

renameTo

public boolean renameTo(File dest)
Overrides:
renameTo in class File

deleteOnExit

public void deleteOnExit()
Overrides:
deleteOnExit 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

@Deprecated
public boolean delete(boolean synchronous)
Deprecated. create GridFilesystem instance with additional FORCE_SYNCHRONOUS flag, if operations should be executed synchronously


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

setLastModified

public boolean setLastModified(long time)
Overrides:
setLastModified 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

canRead

public boolean canRead()
Overrides:
canRead in class File

canWrite

public boolean canWrite()
Overrides:
canWrite in class File

isHidden

public boolean isHidden()
Overrides:
isHidden in class File

canExecute

public boolean canExecute()
Overrides:
canExecute 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

toString

public String toString()
Overrides:
toString in class File

toURL

public URL toURL()
          throws MalformedURLException
Overrides:
toURL in class File
Throws:
MalformedURLException

toURI

public URI toURI()
Overrides:
toURI in class File

setReadOnly

public boolean setReadOnly()
Overrides:
setReadOnly in class File

setWritable

public boolean setWritable(boolean writable,
                           boolean ownerOnly)
Overrides:
setWritable in class File

setWritable

public boolean setWritable(boolean writable)
Overrides:
setWritable in class File

setReadable

public boolean setReadable(boolean readable,
                           boolean ownerOnly)
Overrides:
setReadable in class File

setReadable

public boolean setReadable(boolean readable)
Overrides:
setReadable in class File

setExecutable

public boolean setExecutable(boolean executable,
                             boolean ownerOnly)
Overrides:
setExecutable in class File

setExecutable

public boolean setExecutable(boolean executable)
Overrides:
setExecutable in class File

getTotalSpace

public long getTotalSpace()
Overrides:
getTotalSpace in class File

getFreeSpace

public long getFreeSpace()
Overrides:
getFreeSpace in class File

getUsableSpace

public long getUsableSpace()
Overrides:
getUsableSpace in class File

Infinispan Distribution 5.2.6.Final-redhat-2

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