blackboard.data
Class BbFile

java.lang.Object
  extended by blackboard.data.BbFile

public class BbFile
extends java.lang.Object

Provides a wrapper around file elements for attaching to data objects within the persistence framework.

Since:
Bb 5.5

Field Summary
static long UNKNOWN_SIZE
          Can be used to specify an unknown file size for a BbFile
static BbFile UNSET_FILE
           
 
Constructor Summary
BbFile(java.io.File file, java.lang.String filename)
          Constructs a BbFile for the given File, using the specified filename.
BbFile(java.io.File file, java.lang.String filename, boolean isMovable)
          Constructs a BbFile for the given File, using the specified filename as the internal filename, and specifying whether the file is movable from its current location.
BbFile(java.lang.String path)
          Constructs a BbFile with the given path.
BbFile(java.lang.String path, long fileSize)
          Constructs a BbFile with the given path and file size.
BbFile(java.lang.String path, java.lang.String filename)
          Constructs a BbFile with the given path and filename.
BbFile(java.lang.String path, java.lang.String filename, long fileSize)
          Constructs a BbFile with the given path and filename and file size.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Overrides the equals() method in Object to provide a simple way to compare two BbFile objects.
 java.lang.String getDisplayFilename()
           
 java.io.File getFile()
          Returns the underlying File represented by this BbFile.
 java.lang.String getFilename()
          Returns the displayable filename for the associated file.
 boolean getIsMoveable()
          Returns flag noting whether associated file content can be moved from its current directory.
 java.lang.String getPath()
          Returns the path value of this object.
 long getSize()
          Returns the file size value for this BbFile.
 int hashCode()
           
 java.lang.String toString()
          Returns the contents of this BbFile object as a single line separated list of name value pairs of this object's properties.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN_SIZE

public static final long UNKNOWN_SIZE
Can be used to specify an unknown file size for a BbFile

See Also:
Constant Field Values

UNSET_FILE

public static final BbFile UNSET_FILE
Constructor Detail

BbFile

public BbFile(java.io.File file,
              java.lang.String filename)
Constructs a BbFile for the given File, using the specified filename.


BbFile

public BbFile(java.io.File file,
              java.lang.String filename,
              boolean isMovable)
Constructs a BbFile for the given File, using the specified filename as the internal filename, and specifying whether the file is movable from its current location.


BbFile

public BbFile(java.lang.String path)
Constructs a BbFile with the given path.


BbFile

public BbFile(java.lang.String path,
              long fileSize)
Constructs a BbFile with the given path and file size.


BbFile

public BbFile(java.lang.String path,
              java.lang.String filename)
Constructs a BbFile with the given path and filename.


BbFile

public BbFile(java.lang.String path,
              java.lang.String filename,
              long fileSize)
Constructs a BbFile with the given path and filename and file size.

Method Detail

getFile

public java.io.File getFile()
Returns the underlying File represented by this BbFile. Note: This value is often not set; only call this method if you are confident that the BbFile was constructed with a File handle.


getFilename

public java.lang.String getFilename()
Returns the displayable filename for the associated file.


getDisplayFilename

public java.lang.String getDisplayFilename()
Returns:
the file name to be displayed, either the file name if specified, or a file name extracted from the actual path

getIsMoveable

public boolean getIsMoveable()
Returns flag noting whether associated file content can be moved from its current directory.


getPath

public java.lang.String getPath()
Returns the path value of this object. If the file is in local storage, this will be an absolute path including the filename. If the file is in Xythos, the path will be an XID URL (e.g. "/xid-1234").

Returns:
a String representing the path of this BbFile

getSize

public long getSize()
Returns the file size value for this BbFile.

Returns:
a long representing the file size of this Course. UNKNOWN_SIZE is returned if the size is not known.

equals

public boolean equals(java.lang.Object obj)
Overrides the equals() method in Object to provide a simple way to compare two BbFile objects.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to be compared.
Returns:
true if the two Objects are the same, false otherwise.

hashCode

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

toString

public java.lang.String toString()
Returns the contents of this BbFile object as a single line separated list of name value pairs of this object's properties. This method can be used for debug purposes.

Overrides:
toString in class java.lang.Object
Returns:
a String that represents the contents of this object


Copyright © 2012 Blackboard, Inc. All Rights Reserved.