apps.mtdesktop.fileutility
Class Uploader

java.lang.Object
  extended by apps.mtdesktop.fileutility.Uploader

public class Uploader
extends java.lang.Object

The Class Uploader.


Field Summary
static java.lang.String ASSET_ID
          The Constant ASSET_ID.
static int BUFFER_SIZE
          The Constant BUFFER_SIZE.
static java.lang.String CLIENT_ID_HEADER
          The Constant CLIENT_ID_HEADER.
static java.lang.String DESTINATION_PATH_HEADER
          The Constant DESTINATION_PATH_HEADER.
static java.lang.String FILE_CHUNK_COUNT_HEADER
          The Constant FILE_CHUNK_COUNT_HEADER.
static java.lang.String FILE_CHUNK_HEADER
          The Constant FILE_CHUNK_HEADER.
static java.lang.String FILE_NAME_HEADER
          The Constant FILE_NAME_HEADER.
static java.lang.String FILE_SIZE
          The Constant FILE_SIZE.
static int MAX_CHUNK_SIZE
          The Constant MAX_CHUNK_SIZE.
 
Constructor Summary
Uploader(AssetRegistry assetRegistry)
          Instantiates a new uploader.
 
Method Summary
 void deleteFile(java.lang.String fileUrl)
          Delete file.
 void uploadFile(java.lang.String ftpServletUrl, java.lang.String assetId, java.io.File file, java.lang.String destinationPath)
          Upload file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ASSET_ID

public static final java.lang.String ASSET_ID
The Constant ASSET_ID.

See Also:
Constant Field Values

BUFFER_SIZE

public static final int BUFFER_SIZE
The Constant BUFFER_SIZE.

See Also:
Constant Field Values

CLIENT_ID_HEADER

public static final java.lang.String CLIENT_ID_HEADER
The Constant CLIENT_ID_HEADER.

See Also:
Constant Field Values

DESTINATION_PATH_HEADER

public static final java.lang.String DESTINATION_PATH_HEADER
The Constant DESTINATION_PATH_HEADER.

See Also:
Constant Field Values

FILE_CHUNK_COUNT_HEADER

public static final java.lang.String FILE_CHUNK_COUNT_HEADER
The Constant FILE_CHUNK_COUNT_HEADER.

See Also:
Constant Field Values

FILE_CHUNK_HEADER

public static final java.lang.String FILE_CHUNK_HEADER
The Constant FILE_CHUNK_HEADER.

See Also:
Constant Field Values

FILE_NAME_HEADER

public static final java.lang.String FILE_NAME_HEADER
The Constant FILE_NAME_HEADER.

See Also:
Constant Field Values

FILE_SIZE

public static final java.lang.String FILE_SIZE
The Constant FILE_SIZE.

See Also:
Constant Field Values

MAX_CHUNK_SIZE

public static final int MAX_CHUNK_SIZE
The Constant MAX_CHUNK_SIZE.

See Also:
Constant Field Values
Constructor Detail

Uploader

public Uploader(AssetRegistry assetRegistry)
Instantiates a new uploader.

Parameters:
assetRegistry - the asset registry
Method Detail

deleteFile

public void deleteFile(java.lang.String fileUrl)
                throws java.io.IOException,
                       java.net.URISyntaxException
Delete file.

Parameters:
fileUrl - the file url
Throws:
java.io.IOException - Signals that an I/O exception has occurred.
java.net.URISyntaxException - the URI syntax exception

uploadFile

public void uploadFile(java.lang.String ftpServletUrl,
                       java.lang.String assetId,
                       java.io.File file,
                       java.lang.String destinationPath)
Upload file.

Parameters:
ftpServletUrl - the ftp servlet url
assetId - the asset id
file - the file
destinationPath - the destination path