public class FileCommand extends SQLCommand
FILE
[INFO [[PATH path_name] | [KEY file_key]]
[COLUMNS column_name[,...]] ] |
[READ [[PATH path_name] | [KEY file_key]] ] |
[CHECKOUT [[PATH path_name] | [KEY file_key]] ] |
[CHECKIN [[PATH path_name] | [KEY file_key]] ] |
[UPLOAD data] |
[CLOSE] |
[CREATE path_name [DESCRIPTION text] [LOCATION store_code]] |
[SUBMIT file_key [GZIP] [CIPHER cipher_key [IVEC iv_key]]
[CHECKSUM checksum_value] [RAW_CHECKSUM raw_checksum_value]
[FILESIZE byte_size]
[ASSOC_FILE assoc_gkey ASSOC_VERSION assoc_nr]
[RAW_CREATE create_time] [RAW_MODIFY modify_time]
LOCATION store_code MIME mime_type] |
[FETCH file_key [VERSION version_nr] [LOCATION file_server]
[LOCKFILE] ] |
[UPDATE file_key [LOCATION store_code]] |
[UNLOCK file_key] |
[LIST directory [RECURSIVE] [COLUMNS column_name[,...]]
[ARCHIVE archive_dt] ] |
[CHECK [CLEAN]]
Usage/* Will return details of index.html */ FILE INFO PATH /docs/index.html /* Will transfer the file without locking it */ FILE READ /docs/index.html /* will LOCK the file and then transfer the file */ FILE CHECKOUT /docs/index.html /* Will check the file lock and if OK open the file for upload */ FILE CHECKIN /docs/index.html /* * Can be called as a series of requests and will be appended to * the current file opened by the CHECKIN command. */ FILE UPLOAD encoded page of file /* completes the CHECKIN process */ FILE CLOSE /* will create a DBFile and return key and locations to upload to */ FILE CREATE /docs/index.html /* will update the DBFile record with the location sent to */ FILE SUBMIT file_key LOCATION store_code MIME application/octet-stream /* will return list of locations to retrieve a file from */ FILE FETCH file_key /* return list of locations to get file from and try to obtain a lock */ FILE FETCH file_key LOCKFILE /* will return list of urls to submit to */ FILE UPDATE file_key /* will return a list of files in the directory */ FILE LIST /docs/web FILE LIST /docs/web ARCHIVE '01 Jan 2006 10:45:00' /* will return a list of bad files in the directory */ FILE CHECK /* will delete the list of bad fies in the directory */ FILE CHECK CLEANTHREAD MODE: SINGLE THREADED command
| Modifier and Type | Field and Description |
|---|---|
protected DBFile |
resultDBFile
Current file for CREATE and UPDATE
|
CURSOR_SIZE| Constructor and Description |
|---|
FileCommand(Connection connection,
Pattern pattern)
Creates a new FileCommand object.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
adjustMimeType(java.lang.String mime) |
void |
appendResult(org.w3c.dom.Element group,
int seq)
appends results to a group in the xml result.
|
protected void |
execute(Parser p)
execute the command.
|
protected java.lang.String |
generateNewFilePath(DataSource ds,
Parser p)
Determines the path of the new file
|
protected DBClass |
getBaseClass(DataSource ds)
Specifies the DBClass to be created by the CREATE option
|
java.lang.String |
getColumnName(int col)
implements getColumnName of interface CommandBuildResultsPlugin.
|
java.lang.String |
getColumnType(int col)
Implements getColumnType of interface CommandBuildResultsPlugin.
|
java.lang.String |
getCursorName()
overrides getCursorName of super class SQLCommand.
|
protected java.lang.String[] |
getDefaultInfoColumns(DataSource ds)
Retrieves default list of columns for the info command
|
protected java.lang.String[] |
getDefaultListColumns(DataSource ds)
Retrieves default list of columns for the info command
|
static java.util.LinkedHashSet |
getFilestores(MutableDataSource mds,
java.lang.String storeCode)
return a list of file stores with its alternate in sequence.
|
java.lang.String |
getRecordID(int row)
Implements getRecordID of interface CommandBuildResultsPlugin.
|
protected java.lang.String |
getType()
get the type of the command during file command run
|
java.lang.Object |
getValue(int row,
int col)
Implements getValue method of interface CommandBuildResultsPlugin.
|
protected void |
loadInfoColumns(DBClass cls,
java.lang.String[] columns)
load info columns
|
protected void |
setType(java.lang.String type)
set the Type of the file command.
|
appendResult, getRecordKey, isExecuteOnlyexecute, extMakeThreadName, getConnection, getPattern, getRawTitle, getTitle, makeThreadName, recordCall, setTitleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetRawTitleprotected DBFile resultDBFile
public FileCommand(Connection connection, Pattern pattern)
connection - the connection the command was issued frompattern - the command patternprotected void execute(Parser p) throws java.lang.Exception
protected java.lang.String adjustMimeType(java.lang.String mime)
public void appendResult(org.w3c.dom.Element group,
int seq)
throws java.lang.Exception
appendResult in class SQLCommandgroup - the group to append toseq - the sequence of the appendjava.lang.Exception - a serious errorpublic java.lang.String getCursorName()
throws java.lang.Exception
getCursorName in interface CommandBuildResultsPlugingetCursorName in class SQLCommandjava.lang.Exception - a serious problemprotected java.lang.String generateNewFilePath(DataSource ds, Parser p) throws java.lang.Exception
ds - Datasourcep - Parserjava.lang.Exception - Serious Errorpublic java.lang.String getColumnName(int col)
col - the column number to namepublic java.lang.String getColumnType(int col)
throws java.lang.Exception
col - the column number to get type ofjava.lang.Exception - Serious Errorpublic java.lang.String getRecordID(int row)
row - the index of the row to identifypublic java.lang.Object getValue(int row,
int col)
throws java.lang.Exception
row - the index of the rowcol - the index of the columnjava.lang.Exception - a serious problemprotected java.lang.String[] getDefaultInfoColumns(DataSource ds)
ds - Current datasourceprotected java.lang.String[] getDefaultListColumns(DataSource ds)
ds - Current datasourceprotected DBClass getBaseClass(DataSource ds) throws NotFoundException
ds - Current datasourceNotFoundException - A class could not be found in the system that is to be usedprotected void loadInfoColumns(DBClass cls, java.lang.String[] columns) throws java.lang.Exception
cls - the classcolumns - the columnsjava.lang.Exception - a serious problem.public static java.util.LinkedHashSet getFilestores(MutableDataSource mds, java.lang.String storeCode) throws java.lang.Exception
mds - mutable data sourcestoreCode - DBFileStore codejava.lang.Exception - a serious errorprotected java.lang.String getType()
protected void setType(java.lang.String type)
type - The type to set.stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.