Package com.hlcl.rql.as

Examples of com.hlcl.rql.as.RQLException


  public void changeToParentDirectory() throws RQLException {
    checkFtpClient();
    try {
      ftpClient.changeToParentDirectory();
    } catch (IOException ex) {
      throw new RQLException("Changing to the parent directory via FTP failed.", ex);
    }
  }
View Full Code Here


    checkFtpClient();
    String[] pathNames = null;
    try {
      pathNames = ftpClient.listNames(pathName);
    } catch (IOException ex) {
      throw new RQLException("List all file names via FTP failed.", ex);
    }
    // no array returned
    if (pathNames == null) {
      throw new RQLException("List all file names via FTP failed with an FTP error 550.");
    }

    // filter and sort whole filename ascending
    SortedSet<String> result = new TreeSet<String>();
    for (String path : pathNames) {
View Full Code Here

  public void changeWorkingDirectory(String directory) throws RQLException {
    checkFtpClient();
    try {
      ftpClient.cwd(directory);
    } catch (IOException ex) {
      throw new RQLException("Changing the directory via FTP failed.", ex);
    }
  }
View Full Code Here

   * Prüft, ob ein FTP Client erstellt wurde.
   */
  private void checkFtpClient() throws RQLException {
    // check for existing ftp client
    if (ftpClient == null) {
      throw new RQLException("The FTP connection to the LS import directory is not created. You have to use openFtpConnection() before.");
    }
  }
View Full Code Here

    try {
      ftpClient.logout();
      ftpClient.disconnect();
      ftpClient = null;
    } catch (IOException ex) {
      throw new RQLException("Disconnect from FTP server did not work.", ex);
    }
  }
View Full Code Here

      IOUtils.copy(in, target);
      in.close();
      target.close();
      return ftpClient.completePendingCommand();
    } catch (IOException ex) {
      throw new RQLException("Download of file with name " + sourceFilename + " via FTP from server " + server + " failed.", ex);
    }
  }
View Full Code Here

  public String getCurrentWorkingDirectory() throws RQLException {
    checkFtpClient();
    try {
      return ftpClient.printWorkingDirectory();
    } catch (IOException ex) {
      throw new RQLException("Retrieving the current working direcory on the FTP server failed.", ex);
    }
  }
View Full Code Here

  public boolean switchToAsciiFileTransfer() throws RQLException {
    checkFtpClient();
    try {
      return ftpClient.setFileType(FTPClient.ASCII_FILE_TYPE);
    } catch (IOException ex) {
      throw new RQLException("File type could not be changed to ASCII");
    }
  }
View Full Code Here

  public boolean switchToBinaryFileTransfer() throws RQLException {
    checkFtpClient();
    try {
      return ftpClient.setFileType(FTPClient.BINARY_FILE_TYPE);
    } catch (IOException ex) {
      throw new RQLException("File type could not be changed to binary");
    }
  }
View Full Code Here

      ftpClient.connect(server);
      ftpClient.login(user, password);
      // change into rd import directory
      ftpClient.changeWorkingDirectory(workingDirectory);
    } catch (IOException ioex) {
      throw new RQLException("FTP client could not be created. Please check attributes given in constructor.", ioex);
    }
  }
View Full Code Here

TOP

Related Classes of com.hlcl.rql.as.RQLException

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.