edu.whoi.ursa.argoDatabase.entity
Class ADBFile

java.lang.Object
  extended by edu.whoi.ursa.argoDatabase.entity.ADBFile
All Implemented Interfaces:
java.io.Serializable

@Entity(name="File")
public class ADBFile
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
private  java.lang.Long id
           
private  java.lang.Long lastModified
           
private  java.util.Calendar lastUpdate
           
private  java.lang.String path
           
private static long serialVersionUID
           
private  java.lang.String type
           
 
Constructor Summary
ADBFile()
           
ADBFile(java.lang.String path, java.lang.String type)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
static java.lang.Long generateID(java.lang.String path)
           
static ADBFile getADBFile(java.io.File file, java.lang.String type)
           
static ADBFile getADBFile(java.lang.Long id)
           
static ADBFile getADBFile(java.lang.String path, java.lang.String type)
          get adbFile
 java.lang.String getDownloadLink()
           
 java.io.File getFile()
           
 java.lang.String getFileName()
           
 java.lang.Long getId()
           
 java.lang.Long getLastModified()
           
 java.util.Calendar getLastUpdate()
           
 java.lang.String getPath()
           
 java.lang.String getType()
           
 java.lang.Boolean needsUpdate()
          Check if file has been modified
 Form printFromSection(Form form)
          Print form section for file download
 Form printFromSection(Form form, java.lang.String sub)
          Print form section for file download
 ADBFile save()
           
 void setId(java.lang.Long id)
           
 void setLastModified(java.lang.Long lastModified)
           
 void setLastUpdate(java.util.Calendar lastUpdate)
           
 void setPath(java.lang.String path)
           
 void setType(java.lang.String type)
           
 java.lang.Long updateLastModified()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

id

private java.lang.Long id

path

private java.lang.String path

lastModified

private java.lang.Long lastModified

lastUpdate

private java.util.Calendar lastUpdate

type

private java.lang.String type
Constructor Detail

ADBFile

public ADBFile()

ADBFile

public ADBFile(java.lang.String path,
               java.lang.String type)
Parameters:
path -
lastModified -
type -
Method Detail

printFromSection

public Form printFromSection(Form form,
                             java.lang.String sub)
Print form section for file download

Parameters:
form -
sub -
Returns:

getDownloadLink

public java.lang.String getDownloadLink()

printFromSection

public Form printFromSection(Form form)
Print form section for file download

Parameters:
form -
Returns:

getADBFile

public static ADBFile getADBFile(java.lang.String path,
                                 java.lang.String type)
get adbFile

Parameters:
path -
type -
Returns:

getADBFile

public static ADBFile getADBFile(java.io.File file,
                                 java.lang.String type)

getADBFile

public static ADBFile getADBFile(java.lang.Long id)

generateID

public static java.lang.Long generateID(java.lang.String path)

getFileName

public java.lang.String getFileName()

getId

public java.lang.Long getId()
Returns:
the id

getLastModified

public java.lang.Long getLastModified()
Returns:
the lastModified

getLastUpdate

public java.util.Calendar getLastUpdate()
Returns:
the lastUpdate

getPath

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

getType

public java.lang.String getType()
Returns:
the type

needsUpdate

public java.lang.Boolean needsUpdate()
                              throws ADBException
Check if file has been modified

Returns:
true if file has been modified. false if it has not been modified. null if path not set or file does not exist
Throws:
ADBException

setId

public void setId(java.lang.Long id)
Parameters:
id - the id to set

setLastModified

public void setLastModified(java.lang.Long lastModified)
Parameters:
lastModified - the lastModified to set

setLastUpdate

public void setLastUpdate(java.util.Calendar lastUpdate)
Parameters:
lastUpdate - the lastUpdate to set

setPath

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

setType

public void setType(java.lang.String type)
Parameters:
type - the type to set

getFile

public java.io.File getFile()

updateLastModified

public java.lang.Long updateLastModified()

save

public ADBFile save()

equals

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