|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectext.tools.ContentToolbox
public class ContentToolbox
| Field Summary | |
|---|---|
static java.lang.String |
CVSVersion
|
| Fields inherited from interface wt.method.RemoteAccess |
|---|
versionID |
| Constructor Summary | |
|---|---|
ContentToolbox()
|
|
| Method Summary | |
|---|---|
void |
createTempDir()
Creates a temporary directoy under Windchill/temp for use with this ContentToolbox object. |
wt.content.ContentHolder |
deleteAllContent(wt.content.ContentHolder theHolder)
Deletes all ContentItems (including Primary) from the ContentHolder. |
void |
deleteContent(wt.content.ContentHolder theHolder,
wt.content.ContentItem theItem)
Deletes the specified ContentItem from the ContentHolder. |
boolean |
deleteDirectory(java.io.File d)
Deletes directory and all subdirs and contained files. |
void |
deletePrimary(wt.doc.WTDocument theDoc)
Deletes the primary content of a WTDocument. |
boolean |
deleteTempDirectory()
Deletes the temporary directory associated with this toolbox. |
static java.io.File |
doUncompressFile(java.lang.String inFileName,
java.lang.String outFileName)
Uncompress the incoming file. |
java.io.File |
downloadContent(wt.content.ApplicationData theItem)
Download the specified ContentItem from the ContentHolder to the temp directory and return it as a File. |
java.io.File |
downloadContent(wt.content.ApplicationData theItem,
java.io.File location)
Download the specified ContentItem from the ContentHolder to the temp directory and return it as a File. |
java.io.File |
downloadContent(wt.content.ApplicationData theItem,
java.lang.String fn)
|
java.io.File |
downloadPrimary(wt.content.FormatContentHolder theDoc)
Downloads and returns the primary content of the WTDocument. |
java.io.File |
downloadPrimary(wt.doc.WTDocument theDoc,
java.io.File location)
Downloads and returns the primary content of the WTDocument to the specified location. |
java.util.Enumeration |
getContents(wt.content.ContentHolder theHolder)
Returns all secondary contents for an object as an Enumeration. |
static java.lang.String |
getExtension(java.lang.String f)
Used to extract and return the extension of a given file. |
static java.lang.String |
getFileName(java.lang.String f)
Used to extract the filename without its extension. |
static java.io.InputStream |
getIsFromContentHolder(wt.content.ContentHolder ch,
wt.content.ContentRoleType crt)
Method getIsFromContentHolder. |
static java.io.InputStream |
getIsFromContentHolder(wt.content.ContentHolder ch,
java.lang.String contentName)
Method getIsFromContentHolder. |
java.io.File |
getTempDir()
Returns the currently assigned temporary directory or null if it hasn't been assigned. |
void |
setTempDir(java.io.File theDirectory)
Assigns the temporary directory for this toolbox to the specified directory. |
wt.content.ContentHolder |
updateContent(wt.content.ContentHolder theHolder,
java.io.File theFile,
java.lang.String filename)
Replaces an existing secondary ContentItem with the specified File if it has the same name or creates a new ContentItem if it does not. |
static void |
updatePrimary(wt.content.FormatContentHolder theDoc,
java.io.File theFile,
java.lang.String filename)
Creates or Updates the primary content of a WTDocument using the specified file. |
static void |
updatePrimary(wt.content.FormatContentHolder theDoc,
java.io.File theFile,
java.lang.String filename,
boolean iterate)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CVSVersion
| Constructor Detail |
|---|
public ContentToolbox()
| Method Detail |
|---|
public void createTempDir()
throws java.io.IOException
java.io.IOException - if there is a problem reading WTPropertiespublic java.io.File getTempDir()
public void setTempDir(java.io.File theDirectory)
throws java.io.FileNotFoundException
theDirectory - - existing directory
java.io.FileNotFoundException
java.io.FileNotFoundException - if the directory does not existpublic boolean deleteDirectory(java.io.File d)
d - File
public boolean deleteTempDirectory()
public java.io.File downloadPrimary(wt.content.FormatContentHolder theDoc)
throws java.io.IOException,
wt.util.WTException,
java.beans.PropertyVetoException
theDoc - - WTDocument object to download primary content from
java.io.IOException
wt.util.WTException
java.beans.PropertyVetoException
wt.util.WTException
public java.io.File downloadPrimary(wt.doc.WTDocument theDoc,
java.io.File location)
throws java.io.IOException,
wt.util.WTException,
java.beans.PropertyVetoException
theDoc - - WTDocument object to download primary content fromlocation - - an existing directory to download to
java.io.IOException
wt.util.WTException
java.beans.PropertyVetoException
wt.util.WTException
public void deletePrimary(wt.doc.WTDocument theDoc)
throws wt.util.WTException,
java.beans.PropertyVetoException
theDoc - - WTDocument object to download primary content from
wt.util.WTException
java.beans.PropertyVetoException
wt.util.WTException
public static void updatePrimary(wt.content.FormatContentHolder theDoc,
java.io.File theFile,
java.lang.String filename)
throws wt.util.WTException,
java.beans.PropertyVetoException,
wt.fc.ObjectNoLongerExistsException,
java.io.FileNotFoundException,
java.io.IOException
theDoc - - WTDocument object to download primary content fromtheFile - - the new primary contentfilename - - the filename to use when creating the content
wt.util.WTException
java.beans.PropertyVetoException
wt.fc.ObjectNoLongerExistsException
java.io.FileNotFoundException
java.io.IOException
wt.fc.ObjectNoLongerExistsException
java.io.FileNotFoundException
wt.util.WTException
java.io.IOException
public static void updatePrimary(wt.content.FormatContentHolder theDoc,
java.io.File theFile,
java.lang.String filename,
boolean iterate)
throws wt.util.WTException,
java.beans.PropertyVetoException,
wt.fc.ObjectNoLongerExistsException,
java.io.FileNotFoundException,
java.io.IOException
wt.util.WTException
java.beans.PropertyVetoException
wt.fc.ObjectNoLongerExistsException
java.io.FileNotFoundException
java.io.IOException
public java.util.Enumeration getContents(wt.content.ContentHolder theHolder)
throws wt.util.WTException,
java.beans.PropertyVetoException
theHolder - - any ContentHolder
wt.util.WTException
java.beans.PropertyVetoException
wt.util.WTException
public java.io.File downloadContent(wt.content.ApplicationData theItem)
throws wt.util.WTException,
java.io.IOException
theItem - - an ApplicationData held by theHolder (remember ApplicationData is a type of ContentItem that represents a file)
wt.util.WTException - if the item can't by found
java.io.IOException
public java.io.File downloadContent(wt.content.ApplicationData theItem,
java.lang.String fn)
throws wt.util.WTException,
java.io.IOException
wt.util.WTException
java.io.IOException
public java.io.File downloadContent(wt.content.ApplicationData theItem,
java.io.File location)
throws wt.util.WTException,
java.io.FileNotFoundException,
java.io.IOException
theItem - - an ApplicationData held by theHolder (remember ApplicationData is a type of ContentItem that represents a file)location - - an existing directory to download to
wt.util.WTException - if the item can't by found
java.io.FileNotFoundException - if the file doesn't exist
java.io.IOException
public void deleteContent(wt.content.ContentHolder theHolder,
wt.content.ContentItem theItem)
throws wt.util.WTException,
java.beans.PropertyVetoException
theHolder - - any ContentHoldertheItem - - a ContentItem held by theHolder
wt.util.WTException - if the item can't by found
java.beans.PropertyVetoException
public wt.content.ContentHolder deleteAllContent(wt.content.ContentHolder theHolder)
throws wt.util.WTException,
java.beans.PropertyVetoException
theHolder - - any ContentHolder
wt.util.WTException - if the item can't by found
java.beans.PropertyVetoException
public wt.content.ContentHolder updateContent(wt.content.ContentHolder theHolder,
java.io.File theFile,
java.lang.String filename)
throws wt.util.WTException,
java.beans.PropertyVetoException,
java.io.FileNotFoundException,
java.io.IOException
theHolder - - any ContentHoldertheFile - - theFile on the server to uploadfilename - - the filename to use when adding the content
wt.util.WTException
java.beans.PropertyVetoException
java.io.FileNotFoundException
java.io.IOException
public static java.io.InputStream getIsFromContentHolder(wt.content.ContentHolder ch,
wt.content.ContentRoleType crt)
throws wt.util.WTException
ch - ContentHoldercrt - ContentRoleType
wt.util.WTException
public static java.io.InputStream getIsFromContentHolder(wt.content.ContentHolder ch,
java.lang.String contentName)
throws wt.util.WTException
ch - ContentHoldercontentName - String
wt.util.WTException
public static java.io.File doUncompressFile(java.lang.String inFileName,
java.lang.String outFileName)
inFileName - Name of the file to be uncompressedoutFileName - New file name, if null old - gz is used
public static java.lang.String getExtension(java.lang.String f)
f - Incoming file to get the extension of
String representing the extension of the incoming
file.public static java.lang.String getFileName(java.lang.String f)
f - Incoming file to get the filename
String representing the filename without its
extension.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||