fr.paris.lutece.plugins.jcr.business
Class AbstractRepositoryFile

java.lang.Object
  extended by fr.paris.lutece.plugins.jcr.business.AbstractRepositoryFile
All Implemented Interfaces:
IRepositoryFile
Direct Known Subclasses:
JcrRepositoryFileImpl, VersionFileImpl

public abstract class AbstractRepositoryFile
extends java.lang.Object
implements IRepositoryFile


Field Summary
static java.lang.String NODE_TYPE_FILE
           
static java.lang.String NODE_TYPE_FILE_RESOURCE
           
static java.lang.String NODE_TYPE_FOLDER
           
static java.lang.String PATH_SEPARATOR
           
static java.lang.String RESOURCE_TYPE
           
 
Constructor Summary
AbstractRepositoryFile()
          An empty constructor
 
Method Summary
 boolean equals(java.lang.Object o)
           
 boolean exists()
          Test the existence of the file
 java.lang.String getAbsolutePath()
          Get the absolute path
 java.io.InputStream getContent()
          Get the content of the file, if it is a file
protected abstract  java.lang.String getElementName()
           
protected  java.lang.String getFormattedDate(java.util.Calendar date)
           
 java.lang.String getMimeType()
          Get the Mime type associated with the file content
 java.lang.String getName()
          Get the name of this file
 java.lang.String getParentId()
          Get the parent id of this file
 java.lang.String getPath()
          Get the path of this file
 java.lang.String getResourceId()
          Return the resource id
 java.lang.String getResourceTypeCode()
          Return the resource type
 javax.jcr.Session getSession()
           
 java.lang.String getXml()
          Get the xml representation of this file
protected abstract  java.lang.StringBuffer getXmlContent()
           
 boolean isDirectory()
          Test the type of this file
 boolean isFile()
          Test the type of this file
 java.util.Calendar lastModified()
          Get the date of last modification
 long length()
          Get the length of the file content
 void setAbsolutePath(java.lang.String absolutePath)
           
 void setContent(java.io.InputStream content)
          Set the content of the file
 void setDirectory(boolean isDirectory)
           
 void setExists(boolean exists)
           
 void setFile(boolean isFile)
           
 void setLastModified(java.util.Calendar lastModified)
           
 void setLength(long length)
           
 void setMimeType(java.lang.String mimeType)
           
 void setName(java.lang.String strName)
          Set the name of this file
 void setParentId(java.lang.String strParentId)
           
 void setPath(java.lang.String path)
           
 void setResourceId(java.lang.String strResourceId)
           
 void setSession(javax.jcr.Session session)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PATH_SEPARATOR

public static final java.lang.String PATH_SEPARATOR
See Also:
Constant Field Values

RESOURCE_TYPE

public static final java.lang.String RESOURCE_TYPE
See Also:
Constant Field Values

NODE_TYPE_FOLDER

public static final java.lang.String NODE_TYPE_FOLDER
See Also:
Constant Field Values

NODE_TYPE_FILE

public static final java.lang.String NODE_TYPE_FILE
See Also:
Constant Field Values

NODE_TYPE_FILE_RESOURCE

public static final java.lang.String NODE_TYPE_FILE_RESOURCE
See Also:
Constant Field Values
Constructor Detail

AbstractRepositoryFile

public AbstractRepositoryFile()
An empty constructor

Method Detail

exists

public boolean exists()
Description copied from interface: IRepositoryFile
Test the existence of the file

Specified by:
exists in interface IRepositoryFile
Returns:
the _bExists

setExists

public void setExists(boolean exists)
Parameters:
exists - the _bExists to set

isDirectory

public boolean isDirectory()
Description copied from interface: IRepositoryFile
Test the type of this file

Specified by:
isDirectory in interface IRepositoryFile
Returns:
the _bIsDirectory

setDirectory

public void setDirectory(boolean isDirectory)
Parameters:
isDirectory - the _bIsDirectory to set

isFile

public boolean isFile()
Description copied from interface: IRepositoryFile
Test the type of this file

Specified by:
isFile in interface IRepositoryFile
Returns:
the _bIsFile

setFile

public void setFile(boolean isFile)
Parameters:
isFile - the _bIsFile to set

getContent

public java.io.InputStream getContent()
Description copied from interface: IRepositoryFile
Get the content of the file, if it is a file

Specified by:
getContent in interface IRepositoryFile
Returns:
the _content

setContent

public void setContent(java.io.InputStream content)
Description copied from interface: IRepositoryFile
Set the content of the file

Specified by:
setContent in interface IRepositoryFile
Parameters:
content - the _content to set

getSession

public javax.jcr.Session getSession()
Returns:
the session

setSession

public void setSession(javax.jcr.Session session)
Parameters:
session - the _session to set

getAbsolutePath

public java.lang.String getAbsolutePath()
Description copied from interface: IRepositoryFile
Get the absolute path

Specified by:
getAbsolutePath in interface IRepositoryFile
Returns:
the _strAbsolutePath

setAbsolutePath

public void setAbsolutePath(java.lang.String absolutePath)
Parameters:
absolutePath - the _strAbsolutePath to set

getMimeType

public java.lang.String getMimeType()
Description copied from interface: IRepositoryFile
Get the Mime type associated with the file content

Specified by:
getMimeType in interface IRepositoryFile
Returns:
the _strMimeType

setMimeType

public void setMimeType(java.lang.String mimeType)
Parameters:
mimeType - the _strMimeType to set

setPath

public void setPath(java.lang.String path)
Parameters:
path - the _strPath to set

getPath

public java.lang.String getPath()
Description copied from interface: IRepositoryFile
Get the path of this file

Specified by:
getPath in interface IRepositoryFile
Returns:
the path
See Also:
IRepositoryFile.getPath()

getName

public java.lang.String getName()
Description copied from interface: IRepositoryFile
Get the name of this file

Specified by:
getName in interface IRepositoryFile
Returns:
the name
See Also:
IRepositoryFile.getName()

lastModified

public java.util.Calendar lastModified()
Description copied from interface: IRepositoryFile
Get the date of last modification

Specified by:
lastModified in interface IRepositoryFile
Returns:
the last modified date
See Also:
IRepositoryFile.lastModified()

length

public long length()
Description copied from interface: IRepositoryFile
Get the length of the file content

Specified by:
length in interface IRepositoryFile
Returns:
the file size
See Also:
IRepositoryFile.length()

setLength

public void setLength(long length)
Parameters:
length - the file size

getResourceId

public java.lang.String getResourceId()
Description copied from interface: IRepositoryFile
Return the resource id

Specified by:
getResourceId in interface IRepositoryFile
Returns:
the resource ID
See Also:
RBACResource.getResourceId()

setResourceId

public void setResourceId(java.lang.String strResourceId)
Parameters:
strResourceId - the resource ID

getResourceTypeCode

public java.lang.String getResourceTypeCode()
Description copied from interface: IRepositoryFile
Return the resource type

Specified by:
getResourceTypeCode in interface IRepositoryFile
Returns:
the resource type code
See Also:
RBACResource.getResourceTypeCode()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object
Parameters:
o - the object to compare
Returns:
true has same path as o
See Also:
Object.equals(java.lang.Object)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
custom String representation
See Also:
Object.toString()

getXml

public java.lang.String getXml()
Description copied from interface: IRepositoryFile
Get the xml representation of this file

Specified by:
getXml in interface IRepositoryFile
Returns:
xml representation
See Also:
IRepositoryFile.getXml()

getXmlContent

protected abstract java.lang.StringBuffer getXmlContent()

setLastModified

public void setLastModified(java.util.Calendar lastModified)
Parameters:
lastModified - the date of last modification

getFormattedDate

protected java.lang.String getFormattedDate(java.util.Calendar date)
Parameters:
date - the date to format
Returns:
a formatted date

setName

public void setName(java.lang.String strName)
Description copied from interface: IRepositoryFile
Set the name of this file

Specified by:
setName in interface IRepositoryFile
Parameters:
strName - the name of the file
See Also:
IRepositoryFile.setName(java.lang.String)

getParentId

public java.lang.String getParentId()
Description copied from interface: IRepositoryFile
Get the parent id of this file

Specified by:
getParentId in interface IRepositoryFile
Returns:
the parent id or null if it has no parents

setParentId

public void setParentId(java.lang.String strParentId)

getElementName

protected abstract java.lang.String getElementName()


Copyright © 2007 Mairie de Paris. All Rights Reserved.