com.collabnet.ce.soap60.webservices.filestorage

## Interface ISimpleFileStorageAppSoap

- All Known Implementing Classes:
    SimpleFileStorageAppSoapMockStub, SimpleFileStorageAppSoapStub

      public interface ISimpleFileStorageAppSoap

  Provides SOAP web service for uploading/downloading files. Uploaded files are assigned a "temporary file storage id" which must be used within the SOAP session to create a document/FRS file/etc. Otherwise, the uploaded file is simply discarded. This service is primarily meant for clients which are unable to use SOAP file attachments for uploading/downloading files. Uploading/downloading files as attachments is much more efficient than returning them in memory. The "FileStorageApp" service provides support for uploading/downloading files as attachments.

  Change History
  Version 16.3
  - read2 New method, accepts long offset to support downloading large files
  Version 4.3: No changes.
  Since:
    4.1

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `endFileUpload(String sessionId, String fileStorageId)` Closes and saves uploaded file.
    `long` | `getSize(String sessionId, String fileStorageId)` Returns size of the specified temporary storage file in bytes.
    `byte[]` | `read(String sessionId, String fileStorageId, int offset, int length)` Reads from file a specified a number of bytes from the offset specified.
    `byte[]` | `read2(String sessionId, String fileStorageId, long offset, int length)` Reads from file a specified a number of bytes from the offset specified.
    `String` | `startFileUpload(String sessionId)` Opens a new file descriptor for uploading and returns the temporary storage id.
    `void` | `write(String sessionId, String fileStorageId, byte[] data)` Appends data to the file being uploaded.

- - ### Method Detail

    - #### startFileUpload

          String startFileUpload(String sessionId)
                          throws RemoteException

      Opens a new file descriptor for uploading and returns the temporary storage id.
      Parameters:
        `sessionId` - User session id.
      Returns:
        File storage id.
      Throws:
        `com.collabnet.ce.soap60.fault.InvalidSessionFault` - when the specified session id is invalid.
        `com.collabnet.ce.soap60.fault.SystemFault` - when an unexpected system level error is encountered.
        `RemoteException`
      Since:
        4.1

    - #### write

          void write(String sessionId,
                     String fileStorageId,
                     byte[] data)
              throws RemoteException

      Appends data to the file being uploaded.
      Parameters:
        `sessionId` - User session id.
        `fileStorageId` - Id of temporary file storage for the file being uploaded.
        `data` - Data to be uploaded.
      Throws:
        `com.collabnet.ce.soap60.fault.InvalidSessionFault` - when the specified session id is invalid.
        `com.collabnet.ce.soap60.fault.SystemFault` - when an unexpected system level error is encountered.
        `com.collabnet.ce.soap60.fault.IllegalArgumentFault` - when the specified fileStorageId is invalid.
        `RemoteException`
      Since:
        4.1

    - #### endFileUpload

          void endFileUpload(String sessionId,
                             String fileStorageId)
                      throws RemoteException

      Closes and saves uploaded file.
      Parameters:
        `sessionId` - User session id.
        `fileStorageId` - Id of temporary file storage for the file to finish uploading.
      Throws:
        `com.collabnet.ce.soap60.fault.InvalidSessionFault` - when the specified session id is invalid.
        `com.collabnet.ce.soap60.fault.SystemFault` - when an unexpected system level error is encountered.
        `com.collabnet.ce.soap60.fault.IllegalArgumentFault` - when the specified fileStorageId is invalid.
        `RemoteException`
      Since:
        4.1

    - #### getSize

          long getSize(String sessionId,
                       String fileStorageId)
                throws RemoteException

      Returns size of the specified temporary storage file in bytes.
      Parameters:
        `sessionId` - User session id.
        `fileStorageId` - Id of temporary file storage.
      Returns:
        File size in number of bytes.
      Throws:
        `com.collabnet.ce.soap60.fault.InvalidSessionFault` - when the specified session id is invalid.
        `com.collabnet.ce.soap60.fault.SystemFault` - when an unexpected system level error is encountered.
        `com.collabnet.ce.soap60.fault.IllegalArgumentFault` - when the specified fileStorageId is invalid.
        `RemoteException`
      Since:
        4.1

    - #### read

          byte[] read(String sessionId,
                      String fileStorageId,
                      int offset,
                      int length)
               throws RemoteException

      Reads from file a specified a number of bytes from the offset specified.
      Parameters:
        `sessionId` - User session id.
        `fileStorageId` - Id of temporary file storage returned by DocmentApp.getDocumentFileId or FrsApp.getFrsFileId
        `offset` - Offset within file from where to read.
        `length` - Number of bytes to read.
      Returns:
        Data read from the file as a byte array. Returns null on file end.
      Throws:
        `com.collabnet.ce.soap60.fault.InvalidSessionFault` - when the specified session id is invalid.
        `com.collabnet.ce.soap60.fault.SystemFault` - when an unexpected system level error is encountered.
        `com.collabnet.ce.soap60.fault.PermissionDeniedFault` - when the user doesn't have permission to view the file
        `com.collabnet.ce.soap60.fault.IllegalArgumentFault` - when the specified fileStorageId is invalid.
        `RemoteException`
      Since:
        4.1

    - #### read2

          byte[] read2(String sessionId,
                       String fileStorageId,
                       long offset,
                       int length)
                throws RemoteException

      Reads from file a specified a number of bytes from the offset specified.
      Parameters:
        `sessionId` - User session id.
        `fileStorageId` - Id of temporary file storage returned by DocmentApp.getDocumentFileId or FrsApp.getFrsFileId
        `offset` - Offset within file from where to read (long).
        `length` - Number of bytes to read.
      Returns:
        Data read from the file as a byte array. Returns null on file end.
      Throws:
        `com.collabnet.ce.soap60.fault.InvalidSessionFault` - when the specified session id is invalid.
        `com.collabnet.ce.soap60.fault.SystemFault` - when an unexpected system level error is encountered.
        `com.collabnet.ce.soap60.fault.PermissionDeniedFault` - when the user doesn't have permission to view the file
        `com.collabnet.ce.soap60.fault.IllegalArgumentFault` - when the specified fileStorageId is invalid.
        `RemoteException`
      Since:
        16.3

Copyright © 2020 CollabNet. All rights reserved.