Package org.apache.airavata.gfac

Examples of org.apache.airavata.gfac.ToolsException


            ftpClient.get(remoteFile, localFile);

            log.info("Download file to:" + localFile + " is done");

        } catch (ServerException e) {
            throw new ToolsException("Cannot download file from GridFTP:" + contactInfo.toString(), e);
        } catch (IOException e) {
            throw new ToolsException("Cannot download file from GridFTP:" + contactInfo.toString(), e);
        } catch (ClientException e) {
            throw new ToolsException("Cannot download file from GridFTP:" + contactInfo.toString(), e);
        } finally {
            if (ftpClient != null) {
                try {
                    //ftpClient.close();
                    ftpClient.close(false);
View Full Code Here


            log.info("finish read file:" + localTempfile);

            return buff.toString();
        } catch (FileNotFoundException e) {
            throw new ToolsException("Cannot read localfile file:" + localTempfile, e);
        } catch (IOException e) {
            throw new ToolsException("Cannot read localfile file:" + localTempfile, e);
        } finally {
            if (instream != null) {
                try {
                    instream.close();
                } catch (Exception e) {
View Full Code Here

            } else {
                log.debug("****CHECK SUM FAILED****");
            }

        } catch (ServerException e) {
            throw new ToolsException("Cannot transfer file from GridFTP:" + srchost.toString() + " to "
                    + desthost.toString(), e);
        } catch (IOException e) {
            throw new ToolsException("Cannot transfer file from GridFTP:" + srchost.toString() + " to "
                    + desthost.toString(), e);
        } catch (ClientException e) {
            throw new ToolsException("Cannot transfer file from GridFTP:" + srchost.toString() + " to "
                    + desthost.toString(), e);
        } finally {
            if (destClient != null) {
                try {
                    destClient.close();
View Full Code Here

            if (fileInfo.get(j) instanceof MlsxEntry) {
              name = ((MlsxEntry) fileInfo.get(j)).getFileName();
            } else if (fileInfo.get(j) instanceof FileInfo) {
              name = ((FileInfo) fileInfo.get(j)).getName();
            } else {
              throw new ToolsException("Unsupported type returned by gridftp " + fileInfo.get(j));
            }

            if (!name.equals(".") && !name.equals("..")) {
              URI uri = GFacUtils.createGsiftpURI(contactInfo.hostName, dirURI.getPath() + File.separator + name);
              files.add(uri.getPath());
            }
          }
        }
        return files;
      } catch (IOException e) {
        throw new ToolsException("Could not list directory: " + dirURI.toString() ,e);
      } catch (ServerException e) {
        throw new ToolsException("Could not list directory: " + dirURI.toString() ,e);
      } catch (ClientException e) {
        throw new ToolsException("Could not list directory: " + dirURI.toString() ,e);
      } catch (URISyntaxException e) {
        throw new ToolsException("Error creating URL of listed files: " + dirURI.toString() ,e);
      } finally {
        if (srcClient != null) {
                  try {
                      srcClient.close();
                  } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.apache.airavata.gfac.ToolsException

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.