org.openmobileis.synchro.openmsp.server.util
Class MemoryFile

java.lang.Object
  extended byorg.openmobileis.synchro.openmsp.server.util.MemoryFile
All Implemented Interfaces:
OpenMISFile, OpenMISSerializable, java.io.Serializable
Direct Known Subclasses:
ZipEntryMemoryFile

public class MemoryFile
extends java.lang.Object
implements OpenMISFile

Title: OpenMobileIS project source
Description: memory file

Since:
JDK 1.1
Version:
1.0.
Author:
Philippe Delrieu
See Also:
Serialized Form

Field Summary
protected  byte[] fileData
           
protected  long filedate
           
protected  java.lang.String fileName
           
protected  java.lang.String filePath
          file path.
 
Constructor Summary
  MemoryFile()
           
protected MemoryFile(java.io.InputStream data)
          specified data stream is close during reading.
  MemoryFile(java.lang.String completeName, byte[] data)
           
  MemoryFile(java.lang.String completeName, java.io.InputStream data)
          specified data stream is close during reading.
  MemoryFile(java.lang.String name, java.lang.String path, java.io.InputStream data)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getFileCompleteName()
          return the complete file name of the file (ie: path+separator+name)
 byte[] getFileData()
          return file data as a byte array
 java.io.InputStream getFileDataStream()
          return file data as a stream
 long getFileDate()
          return file last modification date
 int getFileLength()
          return the file data length
 java.lang.String getFileName()
          return the name of the file.
 java.lang.String getFilePath()
          return the path of the file without the file name.
 int hashCode()
           
 void setFileDate(java.util.Date date)
          set file last modification date
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileName

protected java.lang.String fileName

filePath

protected java.lang.String filePath
file path. End with path separator


fileData

protected byte[] fileData

filedate

protected long filedate
Constructor Detail

MemoryFile

public MemoryFile()

MemoryFile

protected MemoryFile(java.io.InputStream data)
              throws java.io.IOException
specified data stream is close during reading.

Parameters:
data -
Throws:
java.io.IOException

MemoryFile

public MemoryFile(java.lang.String completeName,
                  java.io.InputStream data)
           throws java.io.IOException
specified data stream is close during reading.

Parameters:
completeName -
data -
Throws:
java.io.IOException

MemoryFile

public MemoryFile(java.lang.String completeName,
                  byte[] data)
           throws java.io.IOException

MemoryFile

public MemoryFile(java.lang.String name,
                  java.lang.String path,
                  java.io.InputStream data)
           throws java.io.IOException
Method Detail

getFileName

public java.lang.String getFileName()
return the name of the file. The name doesnot contain file path.

Specified by:
getFileName in interface OpenMISFile

getFileDataStream

public java.io.InputStream getFileDataStream()
return file data as a stream

Specified by:
getFileDataStream in interface OpenMISFile

getFilePath

public java.lang.String getFilePath()
return the path of the file without the file name. The path end with system separator.

Specified by:
getFilePath in interface OpenMISFile

getFileDate

public long getFileDate()
Description copied from interface: OpenMISFile
return file last modification date

Specified by:
getFileDate in interface OpenMISFile

setFileDate

public void setFileDate(java.util.Date date)
Description copied from interface: OpenMISFile
set file last modification date

Specified by:
setFileDate in interface OpenMISFile

getFileCompleteName

public java.lang.String getFileCompleteName()
return the complete file name of the file (ie: path+separator+name)

Specified by:
getFileCompleteName in interface OpenMISFile

getFileLength

public int getFileLength()
return the file data length

Specified by:
getFileLength in interface OpenMISFile

getFileData

public byte[] getFileData()
return file data as a byte array

Specified by:
getFileData in interface OpenMISFile

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object obj)


Copyright 2006 OpenMobileIS. All Rights Reserved.