jmaster.jumploader.model.api.upload
Interface IUploader


public interface IUploader

IUploader


Field Summary
static java.lang.String ATTR_MAIN_FILE
          attribute name for main file
static java.lang.String ATTR_ROTATE_ANGLE
          attribute name for image rotate angle
static int STATUS_READY
           
static int STATUS_UPLOADING
           
 
Method Summary
 void addAddListener(IUploaderAddListener listener)
          add IUploaderAddListener
 IUploadFile addDownload(java.lang.String remoteFile, java.lang.String localFile, java.lang.String name)
          add download file
 IUploadFile addFile(java.lang.String path)
          add upload file
 IUploadFile addFile(java.lang.String path, int status)
          add upload file with predefined status
 IUploadFile addFile(java.lang.String path, int status, java.lang.String error)
           
 void addFiles(java.lang.String[] paths)
          add multiple files
 IUploadFile addImage(java.awt.Image image)
          add image for upload
 void addListener(IUploaderListener listener)
          add listener
 IUploadFile addText(java.lang.String text)
          add text file for upload
 void applyTransformations(IUploadFile file)
          apply transformations to the upload file
 boolean canAddFile(java.lang.String path)
          check whether addition of specified file is possible
 boolean canStartUpload()
          shows whether startUpload() action is applicable
 boolean canStopUpload()
          shows whether stopUpload() action is applicable
 void destroy()
          destroy
 void exec(java.lang.String... args)
          execute system process
 int execAndWait(java.lang.String... args)
          execute system process and wait for result
 IUploadFile getAddFileCurrent()
          retrieve current file being added
 IUploadFile[] getAllFiles()
          all files snapshot retrieval
 IAttributeSet getAttributeSet()
          attribute set retrieval
 IUploadFile getFile(int index)
          upload file retrieval
 IUploadFile getFileByPath(java.lang.String path)
          upload file retrieval by path
 int getFileCount()
          upload file count retrieval
 int getFileCountByStatus(int status)
          upload file count retrieval by status
 IUploadFile[] getFilesByStatus(int status)
          upload files retrieval by status
 long getFilesLength()
          all files length retrieval
 IImageInfo getImageInfo(IUploadFile file)
          retrieve image info for specified file
 IListSelection getSelection()
          selection retrieval
 int getStatus()
          status retrieval
 ITransferProgress getTransferProgress()
          transfer progress retrieval, valid if uploading
 IUploadThread getUploadThread(int index)
          upload thread retrieval
 int getUploadThreadCount()
          upload thread count retrieval
 int indexOfFile(IUploadFile uf)
          index of file retrieval
 void init()
          initalizer, called by main
 boolean isAddingFiles()
          check if files being added
 boolean isDestroyed()
          shows if destroyed
 boolean isDownloading()
          shows whether has downloading files
 boolean isFileAdditionEnabled()
          shows whether file addition is enabled
 boolean isFileRemovalEnabled()
          shows whether file removal is enabled
 boolean isPasteEnabled()
          shows whether paste action is available
 boolean isReady()
          ready status check
 boolean isUploadEnabled()
          upload enabled retrieval
 boolean isUploading()
          uploading status check
 void metadataChanged(IUploadFile file)
          notification about changed metadata
 void moveFiles(IUploadFile[] uploadFiles, int insertIndex)
          move files to specified insert index
 boolean pasteFromClipboard()
          paste clipboard content
 void processDocument(IUploadFile file)
          process that document again
 IUploadFile processDocument(java.lang.String key, java.lang.String downloadLocation, java.lang.String uploadLocation, java.lang.String filename, java.lang.String options)
          process document - first download to the temporary file, open editor, then upload back.
 void removeAddListener(IUploaderAddListener listener)
          remove IUploaderAddListener
 void removeFile(IUploadFile uploadFile)
          remove upload file
 void removeListener(IUploaderListener listener)
          remove listener
 void resetImageInfo(IUploadFile file)
          reset image info for specified file
 void retryFileUpload(IUploadFile file)
          retry uplod of specified upload file
 void setFileAdditionEnabled(boolean enabled)
          set file addition is enabled
 void setFileRemovalEnabled(boolean enabled)
          set file removal is enabled
 void setMainFile(IUploadFile uploadFile)
          set "main file" attribute for specified file, remove from previously set
 void setUploadEnabled(boolean enabled)
          upload enabled set
 void startUpload()
          start upload
 void stopAddingFiles()
          interrupt adding files
 void stopFileUpload(IUploadFile file)
          stop uploading specified file
 void stopUpload()
          stop upload
 void updateFile(IUploadFile uploadFile, java.io.File file, boolean preserveName)
          update file, i.e. re-initialize existing entry from another file handle
 void updateFileName(IUploadFile uploadFile, java.lang.String name)
          update file name
 void updateFileStatus(IUploadFile file, int status)
          update file status with notification issue
 

Field Detail

STATUS_READY

static final int STATUS_READY
See Also:
Constant Field Values

STATUS_UPLOADING

static final int STATUS_UPLOADING
See Also:
Constant Field Values

ATTR_MAIN_FILE

static final java.lang.String ATTR_MAIN_FILE
attribute name for main file

See Also:
Constant Field Values

ATTR_ROTATE_ANGLE

static final java.lang.String ATTR_ROTATE_ANGLE
attribute name for image rotate angle

See Also:
Constant Field Values
Method Detail

isDestroyed

boolean isDestroyed()
shows if destroyed


init

void init()
initalizer, called by main


addListener

void addListener(IUploaderListener listener)
add listener


removeListener

void removeListener(IUploaderListener listener)
remove listener


addAddListener

void addAddListener(IUploaderAddListener listener)
add IUploaderAddListener


removeAddListener

void removeAddListener(IUploaderAddListener listener)
remove IUploaderAddListener


isFileAdditionEnabled

boolean isFileAdditionEnabled()
shows whether file addition is enabled


setFileAdditionEnabled

void setFileAdditionEnabled(boolean enabled)
set file addition is enabled


isFileRemovalEnabled

boolean isFileRemovalEnabled()
shows whether file removal is enabled


setFileRemovalEnabled

void setFileRemovalEnabled(boolean enabled)
set file removal is enabled


getFileCount

int getFileCount()
upload file count retrieval


getFile

IUploadFile getFile(int index)
upload file retrieval


getAllFiles

IUploadFile[] getAllFiles()
all files snapshot retrieval


getFileByPath

IUploadFile getFileByPath(java.lang.String path)
upload file retrieval by path

Returns:
null if not found

getFileCountByStatus

int getFileCountByStatus(int status)
upload file count retrieval by status

Parameters:
status - see IUploadFile constants

getFilesByStatus

IUploadFile[] getFilesByStatus(int status)
upload files retrieval by status

Returns:
array of IUploadFile or null, if no such files

indexOfFile

int indexOfFile(IUploadFile uf)
index of file retrieval


getFilesLength

long getFilesLength()
all files length retrieval


addFile

IUploadFile addFile(java.lang.String path)
                    throws jmaster.jumploader.model.api.exception.UploaderException
add upload file

Throws:
jmaster.jumploader.model.api.exception.UploaderException

addFiles

void addFiles(java.lang.String[] paths)
              throws jmaster.jumploader.model.api.exception.UploaderException
add multiple files

Throws:
jmaster.jumploader.model.api.exception.UploaderException

addFile

IUploadFile addFile(java.lang.String path,
                    int status)
                    throws jmaster.jumploader.model.api.exception.UploaderException
add upload file with predefined status

Throws:
jmaster.jumploader.model.api.exception.UploaderException

addFile

IUploadFile addFile(java.lang.String path,
                    int status,
                    java.lang.String error)
                    throws jmaster.jumploader.model.api.exception.UploaderException
Throws:
jmaster.jumploader.model.api.exception.UploaderException

removeFile

void removeFile(IUploadFile uploadFile)
                throws jmaster.jumploader.model.api.exception.UploaderException
remove upload file

Throws:
jmaster.jumploader.model.api.exception.UploaderException

moveFiles

void moveFiles(IUploadFile[] uploadFiles,
               int insertIndex)
               throws jmaster.jumploader.model.api.exception.UploaderException
move files to specified insert index

Throws:
jmaster.jumploader.model.api.exception.UploaderException

getStatus

int getStatus()
status retrieval


isReady

boolean isReady()
ready status check


isUploading

boolean isUploading()
uploading status check


getUploadThreadCount

int getUploadThreadCount()
upload thread count retrieval


getUploadThread

IUploadThread getUploadThread(int index)
upload thread retrieval


startUpload

void startUpload()
                 throws jmaster.jumploader.model.api.exception.UploaderException
start upload

Throws:
jmaster.jumploader.model.api.exception.UploaderException

stopUpload

void stopUpload()
                throws jmaster.jumploader.model.api.exception.UploaderException
stop upload

Throws:
jmaster.jumploader.model.api.exception.UploaderException

canStartUpload

boolean canStartUpload()
shows whether startUpload() action is applicable


canStopUpload

boolean canStopUpload()
shows whether stopUpload() action is applicable


stopFileUpload

void stopFileUpload(IUploadFile file)
                    throws jmaster.jumploader.model.api.exception.UploaderException
stop uploading specified file

Throws:
jmaster.jumploader.model.api.exception.UploaderException

retryFileUpload

void retryFileUpload(IUploadFile file)
                     throws jmaster.jumploader.model.api.exception.UploaderException
retry uplod of specified upload file

Throws:
jmaster.jumploader.model.api.exception.UploaderException

getTransferProgress

ITransferProgress getTransferProgress()
transfer progress retrieval, valid if uploading


destroy

void destroy()
destroy


getAttributeSet

IAttributeSet getAttributeSet()
attribute set retrieval


getSelection

IListSelection getSelection()
selection retrieval


isUploadEnabled

boolean isUploadEnabled()
upload enabled retrieval


setUploadEnabled

void setUploadEnabled(boolean enabled)
upload enabled set


canAddFile

boolean canAddFile(java.lang.String path)
check whether addition of specified file is possible


updateFile

void updateFile(IUploadFile uploadFile,
                java.io.File file,
                boolean preserveName)
update file, i.e. re-initialize existing entry from another file handle

Parameters:
uploadFile - an upload file to update
file - a new file handle
preserveName - shows whether old name should be preserved for upload file

updateFileName

void updateFileName(IUploadFile uploadFile,
                    java.lang.String name)
update file name


setMainFile

void setMainFile(IUploadFile uploadFile)
                 throws jmaster.jumploader.model.api.exception.UploaderException
set "main file" attribute for specified file, remove from previously set

Throws:
jmaster.jumploader.model.api.exception.UploaderException

updateFileStatus

void updateFileStatus(IUploadFile file,
                      int status)
update file status with notification issue


applyTransformations

void applyTransformations(IUploadFile file)
                          throws jmaster.jumploader.model.api.exception.UploaderException
apply transformations to the upload file

Throws:
jmaster.jumploader.model.api.exception.UploaderException

metadataChanged

void metadataChanged(IUploadFile file)
notification about changed metadata


isAddingFiles

boolean isAddingFiles()
check if files being added


stopAddingFiles

void stopAddingFiles()
interrupt adding files


getAddFileCurrent

IUploadFile getAddFileCurrent()
retrieve current file being added


addImage

IUploadFile addImage(java.awt.Image image)
                     throws jmaster.jumploader.model.api.exception.UploaderException
add image for upload

Throws:
jmaster.jumploader.model.api.exception.UploaderException

addText

IUploadFile addText(java.lang.String text)
                    throws jmaster.jumploader.model.api.exception.UploaderException
add text file for upload

Throws:
jmaster.jumploader.model.api.exception.UploaderException

getImageInfo

IImageInfo getImageInfo(IUploadFile file)
                        throws jmaster.jumploader.model.api.exception.UploaderException
retrieve image info for specified file

Throws:
jmaster.jumploader.model.api.exception.UploaderException

resetImageInfo

void resetImageInfo(IUploadFile file)
                    throws jmaster.jumploader.model.api.exception.UploaderException
reset image info for specified file

Throws:
jmaster.jumploader.model.api.exception.UploaderException

processDocument

IUploadFile processDocument(java.lang.String key,
                            java.lang.String downloadLocation,
                            java.lang.String uploadLocation,
                            java.lang.String filename,
                            java.lang.String options)
                            throws jmaster.jumploader.model.api.exception.UploaderException
process document - first download to the temporary file, open editor, then upload back.

Throws:
jmaster.jumploader.model.api.exception.UploaderException

isDownloading

boolean isDownloading()
shows whether has downloading files


processDocument

void processDocument(IUploadFile file)
process that document again


addDownload

IUploadFile addDownload(java.lang.String remoteFile,
                        java.lang.String localFile,
                        java.lang.String name)
add download file

Parameters:
remoteFile - a download location (url), required.
localFile - a local file to download to (full path), temporary file will be created if null passed
name - a name to give to UploadFile (displayed to user), if null, download file name will be used

isPasteEnabled

boolean isPasteEnabled()
shows whether paste action is available


pasteFromClipboard

boolean pasteFromClipboard()
paste clipboard content

Returns:
true if pasted, false otherwise

exec

void exec(java.lang.String... args)
execute system process


execAndWait

int execAndWait(java.lang.String... args)
execute system process and wait for result

Returns:
the exit value of the process. by convention, the value 0 indicates normal termination.