com.zipxap.vfs
Class VFSFile

java.lang.Object
  extended by com.zipxap.vfs.VFSFile

public class VFSFile
extends java.lang.Object

This class represents the Virtual-File-System equivalent of a java.io.File. It is different from a java.io.File in that it is not capable of representing a directory. The VFSRepository is analogous to a java.io.File being used as a directory.

MilestoneWhoDate, Time
Initial VersionK PenroseJune 2009

** Note that this table is not intended as an exhaustive list of subtle changes. It is intended to list changes that break the compatibility of older code, or major enhancements/rewrites


Method Summary
 boolean canExecute()
           
 boolean canRead()
           
 boolean canWrite()
           
 int compareTo(VFSFile path)
           
 long created()
           
 boolean delete()
           
 void extractFileToFileSystem(java.io.File fileSystemFile)
          Extract the specified File from the archive file to the local filesystem.
 byte[] getContent()
           
 java.lang.String getCreatedId()
          Retrieve the User ID of the user who created this file.
 long getFreeSpace()
           
 java.io.InputStream getInputStream()
           
 java.lang.String getName()
           
 java.io.OutputStream getOutputStream()
           
 java.lang.String getOwnerId()
           
 java.lang.String getParent()
           
 VFSRepository getParentRepository()
           
 java.lang.String getPath()
           
 long getTotalSpace()
           
 Entry getUnderlyingEntry()
           
 long getUsableSpace()
           
 long lastModified()
           
 long length()
           
 void move(VFSRepository newParent)
          Move this file to the specified parent repository.
 boolean rename(java.lang.String name)
          Rename this file to the specified name.
 void setCreatedId(java.lang.String createdId)
           
 void setLastModified(long time)
           
 void setOwnerId(java.lang.String ownerId)
           
 void setUnderlyingEntry(Entry entry)
           
 void updateContent(byte[] content)
          Replace the content of this file with the specified content.
 void updateContent(java.io.File fileSystemContent)
          Replace the content of this file with the content of the file from the file system.
 void updateContent(java.io.InputStream inputStream)
          Replace the content of this file with the content of the input stream.
 void updateContent(java.util.List<java.lang.Object> beansToSerialize)
          This method performs bean serialization using the JavabeanSerializer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

canExecute

public boolean canExecute()

canRead

public boolean canRead()

canWrite

public boolean canWrite()

compareTo

public int compareTo(VFSFile path)

delete

public boolean delete()

getFreeSpace

public long getFreeSpace()

getName

public java.lang.String getName()
Returns:
the name of this file

getParent

public java.lang.String getParent()
Returns:
the path of the parent repository

getParentRepository

public VFSRepository getParentRepository()
Returns:
the parent repository

getPath

public java.lang.String getPath()
Returns:
the path of this file

getTotalSpace

public long getTotalSpace()
Returns:
the total space on the drive that contains this virtual file system

getUsableSpace

public long getUsableSpace()
Returns:
the total usable space on the drive that contains this virtual file system

created

public long created()
Returns:
the date when this file was created

lastModified

public long lastModified()
Returns:
the date when this file was last modified

length

public long length()
Returns:
the length, in bytes, of this file

rename

public boolean rename(java.lang.String name)
Rename this file to the specified name.

Parameters:
name -
Returns:
true if this file was successfully renamed, else false.

move

public void move(VFSRepository newParent)
Move this file to the specified parent repository.

Parameters:
newParent -

setLastModified

public void setLastModified(long time)

getUnderlyingEntry

public Entry getUnderlyingEntry()
Returns:
the underlying entry which represents this file

setUnderlyingEntry

public void setUnderlyingEntry(Entry entry)

getContent

public byte[] getContent()

getOutputStream

public java.io.OutputStream getOutputStream()

getInputStream

public java.io.InputStream getInputStream()

updateContent

public void updateContent(java.util.List<java.lang.Object> beansToSerialize)
This method performs bean serialization using the JavabeanSerializer.

Parameters:
beansToSerialize -

updateContent

public void updateContent(byte[] content)
Replace the content of this file with the specified content.

Parameters:
content -

updateContent

public void updateContent(java.io.File fileSystemContent)
Replace the content of this file with the content of the file from the file system.

Parameters:
fileSystemContent -

updateContent

public void updateContent(java.io.InputStream inputStream)
Replace the content of this file with the content of the input stream.

Parameters:
inputStream -

getCreatedId

public java.lang.String getCreatedId()
Retrieve the User ID of the user who created this file.

Returns:

setCreatedId

public void setCreatedId(java.lang.String createdId)

getOwnerId

public java.lang.String getOwnerId()

setOwnerId

public void setOwnerId(java.lang.String ownerId)

extractFileToFileSystem

public void extractFileToFileSystem(java.io.File fileSystemFile)
Extract the specified File from the archive file to the local filesystem.