lumis.portal.filesystem
Class PortalFile

Package class diagram package PortalFile
java.lang.Object
  extended by java.io.File
      extended by lumis.portal.filesystem.PortalFile
All Implemented Interfaces:
Serializable, Comparable<File>

@StableMinor(version="6.2",
             sinceVersion="4.1")
public class PortalFile
extends File

A file that resides inside the portal's controlled file system.

Extends the File, embedding the raising of events and portal cluster replication.

Since:
4.1.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
PortalFile(File file)
           
PortalFile(File parent, String child)
          Creates a new portal file from a parent file and a child pathname string.
PortalFile(PortalFilePath portalFilePath)
           
PortalFile(String pathname)
           
PortalFile(String parent, String child)
           
 
Method Summary
 boolean createNewFile()
           
 boolean delete()
           
 void deleteOnExit()
           
 PortalFile getParentPortalFile()
          Returns the PortalFile that is parent of this one.
 PortalFilePath getPortalFilePath()
          Returns the path for this portal file.
 boolean mkdir()
           
 boolean mkdirs()
           
 void recursiveDelete()
          Recursively deletes this file and any child of it.
 boolean renameTo(File dest)
           
 boolean setLastModified(long time)
           
 boolean setReadOnly()
           
 String toString()
           
 
Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createTempFile, createTempFile, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, setExecutable, setExecutable, setReadable, setReadable, setWritable, setWritable, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PortalFile

public PortalFile(PortalFilePath portalFilePath)

PortalFile

public PortalFile(File file)

PortalFile

public PortalFile(File parent,
                  String child)
Creates a new portal file from a parent file and a child pathname string.

If the parent file is an instance of a portal file, the result portal file will have the same PortalBaseFolder, but adds the child string to the parent's relative path. The resulting relative path must be valid and still reside inside the same PortalBaseFolder.

Example: If parent has base folder DATA and relative path "/path", and child is "child.txt", the resulting portal file will have base folder DATA and relative path "/path/child.txt".

Parameters:
parent - the parent file.
child - the child pathname string.
Throws:
NullPointerException - if parent or child is null.
Since:
6.2.0

PortalFile

public PortalFile(String parent,
                  String child)

PortalFile

public PortalFile(String pathname)
Method Detail

getPortalFilePath

public PortalFilePath getPortalFilePath()
Returns the path for this portal file.

Returns:
the path.
Since:
4.1.0

toString

public String toString()
Overrides:
toString in class File

getParentPortalFile

public PortalFile getParentPortalFile()
Returns the PortalFile that is parent of this one. If this file's parent is not a valid PortalFile (because this PortalFile is a relative root), null is returned;

Returns:
the PortalFile that is parent of this one, or null if this PortalFile does not have a parent PortalFile.
Since:
4.1.0

recursiveDelete

public void recursiveDelete()
Recursively deletes this file and any child of it.

Since:
4.1.0

createNewFile

public boolean createNewFile()
                      throws IOException
Overrides:
createNewFile in class File
Throws:
IOException

delete

public boolean delete()
Overrides:
delete in class File

deleteOnExit

public void deleteOnExit()
Overrides:
deleteOnExit in class File

mkdir

public boolean mkdir()
Overrides:
mkdir in class File

mkdirs

public boolean mkdirs()
Overrides:
mkdirs in class File

renameTo

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

setLastModified

public boolean setLastModified(long time)
Overrides:
setLastModified in class File

setReadOnly

public boolean setReadOnly()
Overrides:
setReadOnly in class File


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.