org.apache.lokahi.core.api.file
Class File

java.lang.Object
  extended by org.apache.lokahi.core.common.interfaces.RestObject
      extended by org.apache.lokahi.core.common.interfaces.TMCDao<File>
          extended by org.apache.lokahi.core.api.file.File
All Implemented Interfaces:
Collectable, Dao<File>, Entity, Restable

public class File
extends TMCDao<File>
implements Entity

Version:
$Id: File.java,v 1.3 2006/03/13 21:56:57 drtobes Exp $
Author:
Stephen Toback

Constructor Summary
File()
           
File(int pk, java.lang.String name, java.lang.String discriptor, java.lang.String path, java.sql.Blob content)
           
File(java.lang.String name, java.lang.String content, java.lang.String discriptor, java.lang.String path)
           
 
Method Summary
 java.lang.StringBuilder buildShortXMLRepresentation()
          Builds a short xml representation of this object containing name, and primary key.
 java.lang.StringBuilder buildXMLRepresention()
          Builds a xml representation of this object
 boolean equals(java.lang.Object o)
           
 File fillObject(java.sql.ResultSet r)
          Creates the Dao from the passed resultset, internally calling the appriate constructor.
 File get(int id)
           
 java.lang.String getContent()
           
 java.lang.String getDescriptor()
           
static File getFile(int id)
          Deprecated.  
static java.util.Collection<File> getFiles()
           
 java.lang.String getName()
          Gets the name.
 java.lang.String getPath()
           
 int getPk()
          Gets the primary key
 int hashCode()
           
 void setContent(byte[] content)
           
 void setContent(java.lang.String content)
           
 void setDescriptor(java.lang.String discriptor)
           
 void setName(java.lang.String name)
           
 void setPath(java.lang.String path)
           
 void setPk(int pk)
           
 java.lang.String toString()
           
 
Methods inherited from class org.apache.lokahi.core.common.interfaces.RestObject
elementBuilder, elementBuilder
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

File

public File()

File

public File(java.lang.String name,
            java.lang.String content,
            java.lang.String discriptor,
            java.lang.String path)

File

public File(int pk,
            java.lang.String name,
            java.lang.String discriptor,
            java.lang.String path,
            java.sql.Blob content)
     throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

getPk

public int getPk()
Description copied from interface: Collectable
Gets the primary key

Specified by:
getPk in interface Collectable
Returns:
the int primary key

setPk

public void setPk(int pk)

getName

public java.lang.String getName()
Description copied from interface: Collectable
Gets the name.

Specified by:
getName in interface Collectable
Returns:
the String name.

setName

public void setName(java.lang.String name)

getContent

public java.lang.String getContent()

setContent

public void setContent(byte[] content)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

setContent

public void setContent(java.lang.String content)

getDescriptor

public java.lang.String getDescriptor()

setDescriptor

public void setDescriptor(java.lang.String discriptor)

getPath

public java.lang.String getPath()

setPath

public void setPath(java.lang.String path)

fillObject

public File fillObject(java.sql.ResultSet r)
                throws java.sql.SQLException
Description copied from interface: Dao
Creates the Dao from the passed resultset, internally calling the appriate constructor.

Specified by:
fillObject in interface Dao<File>
Parameters:
r - the resultset from a database call, should include the entire object
Returns:
Object populated from the resultset
Throws:
java.sql.SQLException

get

public File get(int id)
         throws java.sql.SQLException
Specified by:
get in class TMCDao<File>
Throws:
java.sql.SQLException

getFile

public static File getFile(int id)
                    throws java.sql.SQLException
Deprecated. 

Parameters:
id -
Returns:
Throws:
java.sql.SQLException

getFiles

public static java.util.Collection<File> getFiles()
                                           throws java.sql.SQLException
Throws:
java.sql.SQLException

buildShortXMLRepresentation

public java.lang.StringBuilder buildShortXMLRepresentation()
Description copied from interface: Restable
Builds a short xml representation of this object containing name, and primary key.

Specified by:
buildShortXMLRepresentation in interface Restable
Returns:
the xml representation

buildXMLRepresention

public java.lang.StringBuilder buildXMLRepresention()
Description copied from interface: Restable
Builds a xml representation of this object

Specified by:
buildXMLRepresention in interface Restable
Returns:
the xml representation

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object