OBEROn SDK

com.oberon.ooql.sdk
Class FileOperator

java.lang.Object
  extended by com.oberon.ooql.sdk.FileOperator

public class FileOperator
extends java.lang.Object

Class used to perform operations on ObjectObj attached files

Version:
5.0

Field Summary
static int FILE_COPYFROM
          Copy a file from another object
static int FILE_COPYTO
          Copy a file to another object
static int FILE_DELETE
          Remove a file from an object
static int FILE_GET
          Retrieve a file from an object
static int FILE_LOCK
          Copy a file to another object
static int FILE_MOVEFROM
          Move a file from another object
static int FILE_MOVETO
          Move a file to another object
static int FILE_PUT
          Attach a file to an object
static int FILE_RENAME
          Rename a object attached file
static int FILE_UNLOCK
          Copy a file to another object
 
Constructor Summary
FileOperator()
           
 
Method Summary
 void addFileGetName(java.lang.String fileName)
          Add a file to the file download (get) list
 void addFilePutName(java.lang.String fileName)
          Add a file to the file upload (put) list
 void changeFileSpace(java.lang.String fileSpaceName)
          Set the operator type as FILE_RENAME (Change the FileSpace)
 void changeFileType(java.lang.String fileType)
          Set the operator type as FILE_RENAME (Change the FileType)
 void copyFrom(java.lang.String id_class, java.lang.String name, java.lang.String revision, java.lang.String fileTypeName)
          Set the operator type as FILE_COPYFROM (Copy a file from another ObjectObj)
 void copyTo(java.lang.String id_class, java.lang.String name, java.lang.String revision, java.lang.String fileTypeName)
          Set the operator type as FILE_COPYTO (Copy a file to another ObjectObj )
 void delete()
          Set the operator type as FILE_DELETE (Remove a file from an ObjectObj)
 void get()
          Set the operator type as FILE_GET (Download a file from an ObjectObj)
 boolean getAllOption()
          Return the "get-all" flag
 java.util.Vector<java.lang.String> getFileGetNames()
          Return the download (get) file list
 java.util.Vector<java.lang.String> getFilePutNames()
          Return the upload (put) file list
 java.lang.String getFromFileType()
          Return the "get" FileType
 boolean getLock()
          Get the lock flag
 int getOperation()
          Get the operator type
 java.lang.String getOperationCommand(java.lang.String sObjectID, int counter)
          Return the OOQL command to update this ObjectObj with the modified properties.
 boolean getOverwrite()
          Get the overwrite flag for PUT operations
 ProgressCounter getProgressCounter()
          Return the ProgressCounter
 java.lang.String[] getRefObject()
          Get the reference ObjectObj
 boolean getServerSide()
          Get the server side flag
 java.lang.String getToFileSpace()
          Return the "put" FileSpace name
 java.lang.String getToFileType()
          Return the "put" FileType
 java.lang.String getToPath()
          Return the "get" download path
 boolean isGetForce()
          Get the force flag for GET operations
 boolean isGetSync()
          Get the sync flag for GET operations
 boolean isIndexed()
          Get the indexed flag for PUT operations
 void lock()
          Set the operator type as FILE_LOCK (Lock a file for an ObjectObj)
 void moveFrom(java.lang.String id_class, java.lang.String name, java.lang.String revision, java.lang.String fileTypeName)
          Set the operator type as FILE_MOVEFROM (Get/Move a file from another ObjectObj)
 void moveTo(java.lang.String id_class, java.lang.String name, java.lang.String revision, java.lang.String fileTypeName)
          Set the operator type as FILE_MOVETO (Move a file to another ObjectObj )
 java.lang.String operationToString()
          Get the operator type as a String
 void put()
          Set the operator type as FILE_PUT (Upload/Attach a file to an ObjectObj)
 void resetFileNames()
          Reset the file list
 void setAllOption(boolean getAll)
          Set the "get-all" flag
 void setFromFileType(java.lang.String fileType)
          Set the "get" FileType
 void setGetForce(boolean force)
          Set the force flag for GET operations
 void setGetSync(boolean synchronize)
          Set the sync flag for GET operations
 void setIndexed(boolean indexed)
          Set the indexed flag for PUT operations
 void setLock(boolean lock)
          Set the lock flag
 void setOverwrite(boolean overwrite)
          Set the overwrite flag for PUT operations
 void setProgressCounter(ProgressCounter counter)
          Set the ProgressCounter
 void setServerSide(boolean serverSide)
          Set the server side flag
 void setToFileSpace(java.lang.String fileSpaceName)
          Set the "put" FileSpace
 void setToFileType(java.lang.String fileType)
          Set the "put" FileType
 void setToPath(java.lang.String path)
          Set the "get" download path
 java.lang.String toString()
          Return the FileOperator as a single String
 void unlock()
          Set the operator type as FILE_UNLOCK (Unlock a file for an ObjectObj)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FILE_PUT

public static final int FILE_PUT
Attach a file to an object

See Also:
Constant Field Values

FILE_GET

public static final int FILE_GET
Retrieve a file from an object

See Also:
Constant Field Values

FILE_DELETE

public static final int FILE_DELETE
Remove a file from an object

See Also:
Constant Field Values

FILE_RENAME

public static final int FILE_RENAME
Rename a object attached file

See Also:
Constant Field Values

FILE_MOVEFROM

public static final int FILE_MOVEFROM
Move a file from another object

See Also:
Constant Field Values

FILE_COPYFROM

public static final int FILE_COPYFROM
Copy a file from another object

See Also:
Constant Field Values

FILE_MOVETO

public static final int FILE_MOVETO
Move a file to another object

See Also:
Constant Field Values

FILE_COPYTO

public static final int FILE_COPYTO
Copy a file to another object

See Also:
Constant Field Values

FILE_LOCK

public static final int FILE_LOCK
Copy a file to another object

See Also:
Constant Field Values

FILE_UNLOCK

public static final int FILE_UNLOCK
Copy a file to another object

See Also:
Constant Field Values
Constructor Detail

FileOperator

public FileOperator()
Method Detail

setLock

public void setLock(boolean lock)
Set the lock flag

Parameters:
lock - true to lock the ObjectObj's file after the operation (default: true)

getLock

public boolean getLock()
Get the lock flag

See Also:
setLock(boolean)

setServerSide

public void setServerSide(boolean serverSide)
Set the server side flag

Parameters:
serverSide - true to load / write the file from/to a server side folder

getServerSide

public boolean getServerSide()
Get the server side flag


setOverwrite

public void setOverwrite(boolean overwrite)
Set the overwrite flag for PUT operations

Parameters:
overwrite - if true all files associated to the ObjectObj for the same FileType
will be remove before the new file upload is performed

getOverwrite

public boolean getOverwrite()
Get the overwrite flag for PUT operations

See Also:
setOverwrite(boolean)

setIndexed

public void setIndexed(boolean indexed)
Set the indexed flag for PUT operations

Parameters:
indexed - if true the file content and metadata will be indexed for searching
Since:
1.4

isIndexed

public boolean isIndexed()
Get the indexed flag for PUT operations

Since:
1.4
See Also:
setIndexed(boolean)

setGetSync

public void setGetSync(boolean synchronize)
Set the sync flag for GET operations

Parameters:
synchronize - if true the file will be synchronized with the filespace and the user localarea during the GET operation
Since:
2.2_02

isGetSync

public boolean isGetSync()
Get the sync flag for GET operations

Since:
2.2_02
See Also:
setGetSync(boolean)

setGetForce

public void setGetForce(boolean force)
Set the force flag for GET operations

Parameters:
force - if true try to retrieve the file from alternative locations when the user or the most updated is not accessible
Since:
2.2_02

isGetForce

public boolean isGetForce()
Get the force flag for GET operations

Since:
2.2_02
See Also:
setGetForce(boolean)

setFromFileType

public void setFromFileType(java.lang.String fileType)
Set the "get" FileType

Parameters:
fileType - attached files are subdivided into one or more filetypes, this method
set the FileType for the relative file-get operation

getFromFileType

public java.lang.String getFromFileType()
Return the "get" FileType

See Also:
setFromFileType(String)

setToFileType

public void setToFileType(java.lang.String fileType)
Set the "put" FileType

Parameters:
fileType - attached files are subdivided into one or more filetypes, this method
set the FileType for the relative file-put operation

getToFileType

public java.lang.String getToFileType()
Return the "put" FileType

See Also:
setToFileType(String)

setToFileSpace

public void setToFileSpace(java.lang.String fileSpaceName)
Set the "put" FileSpace

Parameters:
fileSpaceName - attached files are stored into different FileSpaces; this method
set the FileSpace name for the relative file-put operation

getToFileSpace

public java.lang.String getToFileSpace()
Return the "put" FileSpace name

See Also:
setToFileSpace(String)

addFileGetName

public void addFileGetName(java.lang.String fileName)
Add a file to the file download (get) list

Parameters:
fileName - the (full path) file name

getFileGetNames

public java.util.Vector<java.lang.String> getFileGetNames()
Return the download (get) file list

Returns:
a vector of file names

addFilePutName

public void addFilePutName(java.lang.String fileName)
Add a file to the file upload (put) list

Parameters:
fileName - the (full path) file name
For the Rename operation, the download and upload lists should have the same length

getFilePutNames

public java.util.Vector<java.lang.String> getFilePutNames()
Return the upload (put) file list

Returns:
a vector of file names

resetFileNames

public void resetFileNames()
Reset the file list

Since:
4.0

setToPath

public void setToPath(java.lang.String path)
Set the "get" download path

Parameters:
path - set the download path for the "get" operation

getToPath

public java.lang.String getToPath()
Return the "get" download path


setAllOption

public void setAllOption(boolean getAll)
Set the "get-all" flag

Parameters:
getAll - true to download all object attached files for the given FileType

getAllOption

public boolean getAllOption()
Return the "get-all" flag

See Also:
setAllOption(boolean)

put

public void put()
Set the operator type as FILE_PUT (Upload/Attach a file to an ObjectObj)


get

public void get()
Set the operator type as FILE_GET (Download a file from an ObjectObj)


delete

public void delete()
Set the operator type as FILE_DELETE (Remove a file from an ObjectObj)


lock

public void lock()
Set the operator type as FILE_LOCK (Lock a file for an ObjectObj)


unlock

public void unlock()
Set the operator type as FILE_UNLOCK (Unlock a file for an ObjectObj)


changeFileSpace

public void changeFileSpace(java.lang.String fileSpaceName)
Set the operator type as FILE_RENAME (Change the FileSpace)

Parameters:
fileSpaceName - the destination FileSpace name

changeFileType

public void changeFileType(java.lang.String fileType)
Set the operator type as FILE_RENAME (Change the FileType)

Parameters:
fileType - the destination FileType

moveFrom

public void moveFrom(java.lang.String id_class,
                     java.lang.String name,
                     java.lang.String revision,
                     java.lang.String fileTypeName)
Set the operator type as FILE_MOVEFROM (Get/Move a file from another ObjectObj)

Parameters:
id_class - the original ObjectObj ID or Class name
name - the original ObjectObj name
revision - the original ObjectObj revision
fileTypeName - the original FileType name

copyFrom

public void copyFrom(java.lang.String id_class,
                     java.lang.String name,
                     java.lang.String revision,
                     java.lang.String fileTypeName)
Set the operator type as FILE_COPYFROM (Copy a file from another ObjectObj)

Parameters:
id_class - the reference ObjectObj ID or Class name
name - the reference ObjectObj name
revision - the reference ObjectObj revision
fileTypeName - the reference FileType name

moveTo

public void moveTo(java.lang.String id_class,
                   java.lang.String name,
                   java.lang.String revision,
                   java.lang.String fileTypeName)
Set the operator type as FILE_MOVETO (Move a file to another ObjectObj )

Parameters:
id_class - the destination ObjectObj ID or Class name
name - the destination ObjectObj name
revision - the destination ObjectObj revision
fileTypeName - the destination FileType name

copyTo

public void copyTo(java.lang.String id_class,
                   java.lang.String name,
                   java.lang.String revision,
                   java.lang.String fileTypeName)
Set the operator type as FILE_COPYTO (Copy a file to another ObjectObj )

Parameters:
id_class - the destination ObjectObj ID or Class name
name - the destination ObjectObj name
revision - the destination ObjectObj revision
fileTypeName - the destination FileType name

getOperation

public int getOperation()
Get the operator type


getRefObject

public java.lang.String[] getRefObject()
Get the reference ObjectObj

Returns:
String[0]=ObjectObj ID or
String[0]=ObjectObj Class name; String[1]=ObjectObj name; String[2]=ObjectObj revision

operationToString

public java.lang.String operationToString()
Get the operator type as a String


toString

public java.lang.String toString()
Return the FileOperator as a single String

Overrides:
toString in class java.lang.Object

getOperationCommand

public java.lang.String getOperationCommand(java.lang.String sObjectID,
                                            int counter)
Return the OOQL command to update this ObjectObj with the modified properties.

Since:
4.0

setProgressCounter

public void setProgressCounter(ProgressCounter counter)
Set the ProgressCounter

Since:
5.0

getProgressCounter

public ProgressCounter getProgressCounter()
Return the ProgressCounter

Since:
5.0

OBEROn SDK

Copyright © 2008-2014 Mirko Solazzi. All Rights Reserved.