コード例 #1
0
 /**
  * Get useful information on this container
  *
  * @return The container info
  * @throws HttpException There was a problem communicating with the server
  * @throws IOException There was a problem communicating with the server
  * @throws FilesException
  */
 public FilesContainerInfo getInfo() throws HttpException, IOException {
   if (client != null) {
     return client.getContainerInfo(this.name);
   } else {
     logger.fatal("This container does not have a valid client !");
   }
   return null;
 }
コード例 #2
0
  /**
   * Returns the contents of this container
   *
   * @return A list of the contents
   * @throws HttpException There was a problem communicating with the server
   * @throws IOException There was a problem communicating with the server
   * @throws FilesAuthorizationException
   * @throws FilesInvalidNameException
   */
  public List<FilesObject> getObjects() throws IOException, HttpException {

    if (client != null) {
      if (objects == null) {
        objects = client.listObjects(this.name);
      }
      return objects;
    } else {
      logger.fatal("This Container has no FilesClient defined !");
    }
    return null;
  }
コード例 #3
0
 /**
  * Creates the container represented by this instance on the server
  *
  * @return Either FilesConstants.CONTAINER_CREATED or FilesConstants.CONTAINER_EXISTED or -1 if
  *     the client has not been set
  * @throws HttpException
  * @throws IOException
  * @throws FilesAuthorizationException
  * @throws FilesInvalidNameException
  */
 public void createContainer() throws HttpException, IOException, FilesException {
   if (client != null) {
     client.createContainer(this.name);
   } else logger.fatal("This Container has no FilesClient defined !");
 }