org.eclipse.emf.emfstore.internal.server.core.subinterfaces
Class FileTransferSubInterfaceImpl

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.server.core.AbstractSubEmfstoreInterface
      extended by org.eclipse.emf.emfstore.internal.server.core.subinterfaces.FileTransferSubInterfaceImpl

public class FileTransferSubInterfaceImpl
extends AbstractSubEmfstoreInterface

The file transfer subinterface.

Author:
pfeifferc

Field Summary
static String ATTACHMENT_FOLDER
          Attachment folder for uploads and downloads.
static String FILE_NAME_DELIMITER
          The delimiter that separates file attachment id, file version and file name in an uploaded file.
static String TEMP_FOLDER
          tmp folder for file uploads to server.
 
Constructor Summary
FileTransferSubInterfaceImpl(AbstractEmfstoreInterface parentInterface)
           
 
Method Summary
 FileChunk downloadFileChunk(ProjectId projectId, FileTransferInformation fileInformation)
          Reads a chunk from the file linked to the fileInformation.
 FileTransferInformation uploadFileChunk(ProjectId projectId, FileChunk fileChunk)
          Writes a chunk to the file linked to the fileInformation in the fileChunk.
 
Methods inherited from class org.eclipse.emf.emfstore.internal.server.core.AbstractSubEmfstoreInterface
execute, getResourceHelper
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMP_FOLDER

public static final String TEMP_FOLDER
tmp folder for file uploads to server.

See Also:
Constant Field Values

ATTACHMENT_FOLDER

public static final String ATTACHMENT_FOLDER
Attachment folder for uploads and downloads.

See Also:
Constant Field Values

FILE_NAME_DELIMITER

public static final String FILE_NAME_DELIMITER
The delimiter that separates file attachment id, file version and file name in an uploaded file.

See Also:
Constant Field Values
Constructor Detail

FileTransferSubInterfaceImpl

public FileTransferSubInterfaceImpl(AbstractEmfstoreInterface parentInterface)
                             throws FatalESException
Parameters:
parentInterface - the parent interface
Throws:
FatalESException - if any fatal error occurs
Method Detail

downloadFileChunk

public FileChunk downloadFileChunk(ProjectId projectId,
                                   FileTransferInformation fileInformation)
                            throws FileTransferException,
                                   InvalidInputException
Reads a chunk from the file linked to the fileInformation.

Parameters:
projectId - project attachment folder
fileInformation - file information object
Returns:
FileChunk
Throws:
FileTransferException - if any error occurs reading the file
InvalidInputException - thrown if one of the parameters is null

uploadFileChunk

public FileTransferInformation uploadFileChunk(ProjectId projectId,
                                               FileChunk fileChunk)
                                        throws FileTransferException,
                                               InvalidInputException
Writes a chunk to the file linked to the fileInformation in the fileChunk. If the data in the file chunk is null, this is treated as a request for a file version.

Parameters:
fileChunk - contains data and information about the file attachment, file version and chunk number
projectId - project id
Returns:
fileInformation containing the (new) file version
Throws:
FileTransferException - if any error occurs writing to the file
InvalidInputException - thrown if one of the parameters is null


Copyright © 2015. All Rights Reserved.