org.mycore.datamodel.ifs
Class MCROldFile

java.lang.Object
  extended by org.mycore.datamodel.ifs.MCROldFile
All Implemented Interfaces:
MCRFileReader

Deprecated. use MCRFile

public class MCROldFile
extends Object
implements MCRFileReader

Represents a stored file with its metadata and content. USED BY MILESS 1.3 ONLY!

Version:
$Revision: 13834 $ $Date: 2008-08-07 15:25:01 +0200 (Do, 07 Aug 2008) $
Author:
Frank Lützenkirchen

Field Summary
protected  MCRAudioVideoExtender avExtender
          Deprecated. The optional extender for streaming audio/video files
protected  String contentTypeID
          Deprecated. The ID of the content type of this file
protected  GregorianCalendar lastModified
          Deprecated. The date of last modification of this file
protected  String md5
          Deprecated. The md5 checksum that was built when content was read for this file
static String oldFileEvent
          Deprecated.  
protected  String ownerID
          Deprecated. The ID of the file owner, e .g.
protected  String path
          Deprecated. The file path
protected  long size
          Deprecated. The file size in number of bytes
protected  String storageID
          Deprecated. The ID that identifies the place where the store holds the content
protected  String storeID
          Deprecated. The ID of the store that holds this file's content
 
Constructor Summary
MCROldFile()
          Deprecated. Creates a new empty, unstored MCROldFile instance.
 
Method Summary
 void deleteContent()
          Deprecated. Deletes the content of this file from the ContentStore used
 MCRAudioVideoExtender getAudioVideoExtender()
          Deprecated. Returns the AudioVideoExtender in case this file is streaming audio/video and stored in a ContentStore that supports this
 String getChecksum()
          Deprecated. Returns the MD5 checksum for this file
 byte[] getContentAsByteArray()
          Deprecated. Gets the content of this file as a byte array
 InputStream getContentAsInputStream()
          Deprecated. Gets an InputStream to read the content of this file from the underlying store.
 Document getContentAsJDOM()
          Deprecated.  
 String getContentAsString()
          Deprecated. Gets the content of this file as a string, using the default encoding
 String getContentAsString(String encoding)
          Deprecated. Gets the content of this file as a string, using the given encoding
protected  MCRContentStore getContentStore()
          Deprecated. Returns the MCRContentStore instance that holds the content of this file
 void getContentTo(File target)
          Deprecated. Writes the content of this file to a file on the local filesystem
 void getContentTo(OutputStream target)
          Deprecated. Writes the content of this file to a target output stream
 MCRFileContentType getContentType()
          Deprecated. This method will throw an UnsupportedOperationException, it is not implemented for MCROldFile class.
 String getContentTypeID()
          Deprecated. Gets the ID of the content type of this file
 String getDirectory()
          Deprecated. Returns the directory of this file
 String getExtension()
          Deprecated. Returns the file extension of this file, or an empty string if the file has no extension
 String getFileName()
          Deprecated. Returns the filename of this file
 String getID()
          Deprecated. Returns the ID of this file
 GregorianCalendar getLastModified()
          Deprecated. Returns the time of last modification of this file
 String getOwnerID()
          Deprecated. Returns the ID of the owner of this file
 String getPath()
          Deprecated. Returns the relative path of this file
 long getSize()
          Deprecated. Returns the file size as number of bytes
 String getSizeFormatted()
          Deprecated. Returns the file size, formatted as a string
static String getSizeFormatted(long bytes)
          Deprecated. Takes a file size in bytes and formats it as a string for output
 String getStorageID()
          Deprecated. Returns the storage ID that identifies the place where the MCRContentStore has stored the content of this file
 String getStoreID()
          Deprecated. Returns the ID of the MCRContentStore implementation that holds the content of this file
 boolean hasAudioVideoExtender()
          Deprecated. Returns true, if this file is stored in a content store that provides an MCRAudioVideoExtender for audio/video streaming and additional metadata
 void repairSearch()
          Deprecated.  
 void setChecksum(String md5)
          Deprecated. Sets the MD5 checksum for this file
 void setContentFrom(MCRContentInputStream source, MCRContentStore store)
          Deprecated. Reads the content of this file from the source ContentInputStream and stores it in the ContentStore given
 void setContentTypeID(String ID)
          Deprecated. Sets the ID of the content type of this file
 void setLastModified(GregorianCalendar date)
          Deprecated. Sets the time of last modification of this file
 void setOwnerID(String ID)
          Deprecated. Sets the ID of the owner of this file
 void setPath(String path)
          Deprecated. Sets the relative path of this file
 void setSize(long size)
          Deprecated. Sets the file size
 void setStorageID(String ID)
          Deprecated. Sets the storage ID that identifies the place where the MCRContentStore has stored the content of this file
 void setStoreID(String ID)
          Deprecated. Sets the ID of the MCRContentStore implementation that holds the content of this file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

storeID

protected String storeID
Deprecated. 
The ID of the store that holds this file's content


storageID

protected String storageID
Deprecated. 
The ID that identifies the place where the store holds the content


ownerID

protected String ownerID
Deprecated. 
The ID of the file owner, e .g. a MILESS derivate ID


contentTypeID

protected String contentTypeID
Deprecated. 
The ID of the content type of this file


path

protected String path
Deprecated. 
The file path


md5

protected String md5
Deprecated. 
The md5 checksum that was built when content was read for this file


size

protected long size
Deprecated. 
The file size in number of bytes


lastModified

protected GregorianCalendar lastModified
Deprecated. 
The date of last modification of this file


avExtender

protected MCRAudioVideoExtender avExtender
Deprecated. 
The optional extender for streaming audio/video files


oldFileEvent

public static final String oldFileEvent
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

MCROldFile

public MCROldFile()
Deprecated. 
Creates a new empty, unstored MCROldFile instance.

Method Detail

setOwnerID

public void setOwnerID(String ID)
Deprecated. 
Sets the ID of the owner of this file

Parameters:
ID - the non-empty owner ID

getOwnerID

public String getOwnerID()
Deprecated. 
Returns the ID of the owner of this file

Returns:
the ID of the owner of this file

getID

public String getID()
Deprecated. 
Description copied from interface: MCRFileReader
Returns the ID of this file

Specified by:
getID in interface MCRFileReader
Returns:
the ID of this file

setPath

public void setPath(String path)
Deprecated. 
Sets the relative path of this file


getPath

public String getPath()
Deprecated. 
Returns the relative path of this file

Specified by:
getPath in interface MCRFileReader

getFileName

public String getFileName()
Deprecated. 
Returns the filename of this file


getDirectory

public String getDirectory()
Deprecated. 
Returns the directory of this file


getExtension

public String getExtension()
Deprecated. 
Returns the file extension of this file, or an empty string if the file has no extension

Specified by:
getExtension in interface MCRFileReader

setSize

public void setSize(long size)
Deprecated. 
Sets the file size


getSize

public long getSize()
Deprecated. 
Returns the file size as number of bytes

Specified by:
getSize in interface MCRFileReader

getSizeFormatted

public String getSizeFormatted()
Deprecated. 
Returns the file size, formatted as a string


getSizeFormatted

public static String getSizeFormatted(long bytes)
Deprecated. 
Takes a file size in bytes and formats it as a string for output


setChecksum

public void setChecksum(String md5)
Deprecated. 
Sets the MD5 checksum for this file


getChecksum

public String getChecksum()
Deprecated. 
Returns the MD5 checksum for this file


setLastModified

public void setLastModified(GregorianCalendar date)
Deprecated. 
Sets the time of last modification of this file


getLastModified

public GregorianCalendar getLastModified()
Deprecated. 
Returns the time of last modification of this file


setStoreID

public void setStoreID(String ID)
Deprecated. 
Sets the ID of the MCRContentStore implementation that holds the content of this file


getStoreID

public String getStoreID()
Deprecated. 
Returns the ID of the MCRContentStore implementation that holds the content of this file

Specified by:
getStoreID in interface MCRFileReader

setStorageID

public void setStorageID(String ID)
Deprecated. 
Sets the storage ID that identifies the place where the MCRContentStore has stored the content of this file


getStorageID

public String getStorageID()
Deprecated. 
Returns the storage ID that identifies the place where the MCRContentStore has stored the content of this file

Specified by:
getStorageID in interface MCRFileReader

getContentStore

protected MCRContentStore getContentStore()
Deprecated. 
Returns the MCRContentStore instance that holds the content of this file


setContentFrom

public void setContentFrom(MCRContentInputStream source,
                           MCRContentStore store)
                    throws MCRPersistenceException
Deprecated. 
Reads the content of this file from the source ContentInputStream and stores it in the ContentStore given

Throws:
MCRPersistenceException

deleteContent

public void deleteContent()
                   throws MCRPersistenceException
Deprecated. 
Deletes the content of this file from the ContentStore used

Throws:
MCRPersistenceException

getContentTo

public void getContentTo(OutputStream target)
                  throws MCRPersistenceException
Deprecated. 
Writes the content of this file to a target output stream

Throws:
MCRPersistenceException

getContentTo

public void getContentTo(File target)
                  throws MCRPersistenceException,
                         IOException
Deprecated. 
Writes the content of this file to a file on the local filesystem

Throws:
MCRPersistenceException
IOException

getContentAsByteArray

public byte[] getContentAsByteArray()
                             throws MCRPersistenceException
Deprecated. 
Gets the content of this file as a byte array

Throws:
MCRPersistenceException

getContentAsString

public String getContentAsString()
                          throws MCRPersistenceException
Deprecated. 
Gets the content of this file as a string, using the default encoding

Throws:
MCRPersistenceException

getContentAsString

public String getContentAsString(String encoding)
                          throws MCRPersistenceException,
                                 UnsupportedEncodingException
Deprecated. 
Gets the content of this file as a string, using the given encoding

Throws:
MCRPersistenceException
UnsupportedEncodingException

hasAudioVideoExtender

public boolean hasAudioVideoExtender()
Deprecated. 
Returns true, if this file is stored in a content store that provides an MCRAudioVideoExtender for audio/video streaming and additional metadata


getAudioVideoExtender

public MCRAudioVideoExtender getAudioVideoExtender()
Deprecated. 
Returns the AudioVideoExtender in case this file is streaming audio/video and stored in a ContentStore that supports this


setContentTypeID

public void setContentTypeID(String ID)
Deprecated. 
Sets the ID of the content type of this file


getContentTypeID

public String getContentTypeID()
Deprecated. 
Gets the ID of the content type of this file

Specified by:
getContentTypeID in interface MCRFileReader

getContentType

public MCRFileContentType getContentType()
Deprecated. 
This method will throw an UnsupportedOperationException, it is not implemented for MCROldFile class.

Specified by:
getContentType in interface MCRFileReader

getContentAsInputStream

public InputStream getContentAsInputStream()
                                    throws IOException
Deprecated. 
Gets an InputStream to read the content of this file from the underlying store. It is important that you close() the stream when you are finished reading content from it.

Returns:
an InputStream to read the file's content from
Throws:
IOException

getContentAsJDOM

public Document getContentAsJDOM()
                          throws MCRPersistenceException,
                                 IOException,
                                 JDOMException
Deprecated. 
Throws:
MCRPersistenceException
IOException
JDOMException

repairSearch

public void repairSearch()
Deprecated.