Package com.appthwack.appthwack

Examples of com.appthwack.appthwack.AppThwackException


     * @param name name of the file once uploaded.
     * @return reference to remote file on AppThwack.
     */
    public AppThwackFile uploadFile(File file, String name) throws AppThwackException {
        if(file == null) {
            throw new AppThwackException("file cannot be null");
        }
        if(name == null || name.isEmpty()) {
            throw new AppThwackException("name cannot be null or empty");
        }
        if(!file.exists()) {
            throw new AppThwackException("file does not exist");
        }
        if(!file.isFile()) {
            throw new AppThwackException("file cannot be a directory");
        }

        FormDataMultiPart form = new FormDataMultiPart();
        form.field("name", name);
        form.bodyPart(new FileDataBodyPart("file", file, MediaType.APPLICATION_OCTET_STREAM_TYPE));
View Full Code Here


     * @param name name of the file once uploaded.
     * @return reference to remote file on AppThwack.
     */
    public AppThwackFile uploadFile(File file, String name) throws AppThwackException {
        if(file == null) {
            throw new AppThwackException("file cannot be null");
        }
        if(name == null || name.isEmpty()) {
            throw new AppThwackException("name cannot be null or empty");
        }
        if(!file.exists()) {
            throw new AppThwackException("file does not exist");
        }
        if(!file.isFile()) {
            throw new AppThwackException("file cannot be a directory");
        }

        FormDataMultiPart form = new FormDataMultiPart();
        form.field("name", name);
        form.bodyPart(new FileDataBodyPart("file", file, MediaType.APPLICATION_OCTET_STREAM_TYPE));
View Full Code Here

     * @param name name of the file once uploaded.
     * @return reference to remote file on AppThwack.
     */
    public AppThwackFile uploadFile(File file, String name) throws AppThwackException {
        if(file == null) {
            throw new AppThwackException("file cannot be null");
        }
        if(name == null || name.isEmpty()) {
            throw new AppThwackException("name cannot be null or empty");
        }
        if(!file.exists()) {
            throw new AppThwackException("file does not exist");
        }
        if(!file.isFile()) {
            throw new AppThwackException("file cannot be a directory");
        }

        FormDataMultiPart form = new FormDataMultiPart();
        form.field("name", name);
        form.bodyPart(new FileDataBodyPart("file", file, MediaType.APPLICATION_OCTET_STREAM_TYPE));
View Full Code Here

   * @param name name of the file once uploaded.
   * @return reference to remote file on AppThwack.
   */
  public AppThwackFile uploadFile(File file, String name) throws AppThwackException {
    if(file == null) {
      throw new AppThwackException("file cannot be null");
    }
    if(name == null || name.isEmpty()) {
      throw new AppThwackException("name cannot be null or empty");
    }
    if(!file.exists()) {
      throw new AppThwackException("file does not exist");
    }
    if(!file.isFile()) {
      throw new AppThwackException("file cannot be a directory");
    }
   
    FormDataMultiPart form = new FormDataMultiPart();
    form.field("name", name);
    form.bodyPart(new FileDataBodyPart("file", file, MediaType.APPLICATION_OCTET_STREAM_TYPE));
View Full Code Here

TOP

Related Classes of com.appthwack.appthwack.AppThwackException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.