Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Team Productivity Center
11g Release 1 (11.1.1)
E14128-02


oracle.alm.connector.data
Class DocumentItem

java.lang.Object
  extended by oracle.alm.connector.data.DocumentItem

All Implemented Interfaces:
java.io.Serializable

public class DocumentItem
extends java.lang.Object
implements java.io.Serializable

The document item class is used to denote a file, a folder, or a link in the backend repository or file system. It provides the common attributes for the document, including name, item type, and last modified. It also contains special attributes, like link (which is a shortcut or web link if item type is link), and itemKey (which is a unique id/key used in the repository or file system).

Since:
11.1.1.1.0
See Also:
Serialized Form

Field Summary
static java.lang.String DOC_TYPE_DIR
          The item is a folder.
static java.lang.String DOC_TYPE_FILE
          The item is a file.
static java.lang.String DOC_TYPE_LINK
          The item is a link, such as shortcut or web link.

 

Constructor Summary
DocumentItem()
          Default Constructor.
DocumentItem(DocumentItem di)
          Constructs a document item based on the properties passed in the existing document item.
DocumentItem(java.lang.String key, java.lang.String name)
          Constructs a document item from a link type document item.
DocumentItem(java.lang.String key, java.lang.String name, long lastModified)
          Constructs a document item from a folder type document item.
DocumentItem(java.lang.String key, java.lang.String name, long size, long lastModified)
          Constructs a document item from a file type document item.

 

Method Summary
 void display()
          Shows the properties of document item in standard output stream.
 java.lang.String getItemKey()
          Retrieves the key/id of the document item.
 java.lang.String getItemLink()
          Retrieves the link of the link type document item.
 long getLastModified()
          Retrieves the last modified time of the document item.
 java.lang.String getName()
          Retrieves the name of the document item.
 long getSize()
          Retrieves the size of the document item.
 java.lang.String getType()
          Retrieves the type of the document item.
 boolean isDirectory()
          Determines if the document item is a folder.
 boolean isFile()
          Determines if the document item is a file.
 boolean isLink()
          Determines if the document item is a link.
 void setItemKey(java.lang.String key)
          Sets the key/id of the document item.
 void setItemLink(java.lang.String link)
          Sets the link of a link type document item.
 void setLastModified(long time)
          Sets the last modified time of the document item.
 void setName(java.lang.String name)
          Sets the name of the document item.
 void setSize(long size)
          Sets the size of the document item.
 void setType(java.lang.String type)
          Sets the type of the document item.
 java.lang.String toString()
          Returns the name of the document item.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Field Detail

DOC_TYPE_DIR

public static final java.lang.String DOC_TYPE_DIR
The item is a folder.
See Also:
Constant Field Values

DOC_TYPE_FILE

public static final java.lang.String DOC_TYPE_FILE
The item is a file.
See Also:
Constant Field Values

DOC_TYPE_LINK

public static final java.lang.String DOC_TYPE_LINK
The item is a link, such as shortcut or web link.
See Also:
Constant Field Values

Constructor Detail

DocumentItem

public DocumentItem()
Default Constructor.

DocumentItem

public DocumentItem(DocumentItem di)
Constructs a document item based on the properties passed in the existing document item.
Parameters:
di - existing document item

DocumentItem

public DocumentItem(java.lang.String key,
                    java.lang.String name)
Constructs a document item from a link type document item.
Parameters:
key - document item key
name - document item name

DocumentItem

public DocumentItem(java.lang.String key,
                    java.lang.String name,
                    long lastModified)
Constructs a document item from a folder type document item.
Parameters:
key - document item key
name - document item name
lastModified - the last modified time, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970)

DocumentItem

public DocumentItem(java.lang.String key,
                    java.lang.String name,
                    long size,
                    long lastModified)
Constructs a document item from a file type document item.
Parameters:
key - document item key
name - document item name
size - document item size in bytes
lastModified - the last modified time, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970)

Method Detail

getName

public java.lang.String getName()
Retrieves the name of the document item.
Returns:
the name of document item.

getType

public java.lang.String getType()
Retrieves the type of the document item.
Returns:
the type of document item.

getLastModified

public long getLastModified()
Retrieves the last modified time of the document item.
Returns:
the last modified time of document item.

getSize

public long getSize()
Retrieves the size of the document item.
Returns:
the size in bytes of document item.

getItemLink

public java.lang.String getItemLink()
Retrieves the link of the link type document item.
Returns:
the link of document item.

getItemKey

public java.lang.String getItemKey()
Retrieves the key/id of the document item.
Returns:
the key/id of document item.

setName

public void setName(java.lang.String name)
Sets the name of the document item.
Parameters:
name - document item name

setType

public void setType(java.lang.String type)
Sets the type of the document item. If type is not in the supported types, it will be set to DOC_TYPE_DIR.
Parameters:
type - document item type

setSize

public void setSize(long size)
Sets the size of the document item.
Parameters:
size - document item size

setLastModified

public void setLastModified(long time)
Sets the last modified time of the document item.
Parameters:
time - last modified time of document item.

setItemLink

public void setItemLink(java.lang.String link)
Sets the link of a link type document item.
Parameters:
link - link of document item.

setItemKey

public void setItemKey(java.lang.String key)
Sets the key/id of the document item.
Parameters:
key - key/id of document item.

isDirectory

public boolean isDirectory()
Determines if the document item is a folder.
Returns:
true if this item is a folder, else false.

isFile

public boolean isFile()
Determines if the document item is a file.
Returns:
true if this item is a file, else false.

isLink

public boolean isLink()
Determines if the document item is a link.
Returns:
true if this item is a link, else false.

toString

public java.lang.String toString()
Returns the name of the document item. This is the same as the string returned by the getName() method.
Overrides:
toString in class java.lang.Object
Returns:
The name of this doucment item

display

public void display()
Shows the properties of document item in standard output stream.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Team Productivity Center
11g Release 1 (11.1.1)
E14128-02


Copyright © 1998,2009, Oracle. All rights reserved.