• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java FTPException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.enterprisedt.net.ftp.FTPException的典型用法代码示例。如果您正苦于以下问题:Java FTPException类的具体用法?Java FTPException怎么用?Java FTPException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FTPException类属于com.enterprisedt.net.ftp包,在下文中一共展示了FTPException类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: get

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
@Override
public void get( String arg0, String arg1 ) throws IOException, FTPException {
  FileWriter fw = null;
  try {
    Random r = new Random();
    fw = new FileWriter( arg0 );
    for ( int i = 0; i < 100; i++ ) {
      fw.append( (char) ( r.nextInt( 83 ) + 32 ) );
    }
    fw.flush();
    fw.close();
  } finally {
    if ( fw != null ) {
      fw.close();
    }
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:18,代码来源:MockedFTPClient.java


示例2: connect

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
public void connect() throws FTPException, IOException{
	ftp = new FileTransferClient();
	ftp.setRemoteHost(remoteHost);
	ftp.setRemotePort(remotePort);
	ftp.setUserName(username);
	ftp.setPassword(password);
	ftp.getAdvancedFTPSettings().setConnectMode(FTPConnectMode.PASV);

	ftp.connect();
}
 
开发者ID:knowpd,项目名称:p2p-file-sharing-system,代码行数:11,代码来源:PeerlessFtpClientSupport.java


示例3: dirDetails

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
@Override
public FTPFile[] dirDetails( String arg0 ) throws IOException, FTPException, ParseException {
  FTPFile[] files = new FTPFile[10];
  for ( int i = 0; i < files.length - 1; i++ ) {
    files[i] = new FTPFile( "file_" + i, "file_" + i, 100, false, new Date() );

  }
  files[files.length - 1] = new FTPFile( "robots.txt", "robots.txt", 100, false, new Date() );
  return files;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:11,代码来源:MockedFTPClient.java


示例4: hookInOtherParsers

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
/**
 * Hook in known parsers, and then those that have been specified in the variable
 * ftp.file.parser.class.names
 * @param ftpClient
 * @throws FTPException
 * @throws IOException
 */
protected void hookInOtherParsers(FTPClient ftpClient) throws FTPException, IOException {
  if (log.isDebug()) {logDebug(BaseMessages.getString(PKG, "JobEntryFTP.DEBUG.Hooking.Parsers"));}
  String system = ftpClient.system();
  MVSFileParser parser = new MVSFileParser();
  if (log.isDebug()) {logDebug(BaseMessages.getString(PKG, "JobEntryFTP.DEBUG.Created.MVS.Parser"));}
  FTPFileFactory factory = new FTPFileFactory(system);
  if (log.isDebug()) {logDebug(BaseMessages.getString(PKG, "JobEntryFTP.DEBUG.Created.Factory"));}
  factory.addParser(parser);
  ftpClient.setFTPFileFactory(factory);
  if (log.isDebug()) {logDebug(BaseMessages.getString(PKG, "JobEntryFTP.DEBUG.Get.Variable.Space"));}
  VariableSpace vs = this.getVariables();
  if (vs != null) {
    if (log.isDebug()) {logDebug(BaseMessages.getString(PKG, "JobEntryFTP.DEBUG.Getting.Other.Parsers"));}
    String otherParserNames = vs.getVariable("ftp.file.parser.class.names");
    if (otherParserNames != null) {
      if (log.isDebug()) {logDebug(BaseMessages.getString(PKG, "JobEntryFTP.DEBUG.Creating.Parsers"));}
      String[] parserClasses = otherParserNames.split("|");
      String cName = null;
      Class<?> clazz = null;
      Object parserInstance = null;
      for (int i=0; i<parserClasses.length; i++) {
        cName = parserClasses[i].trim();
        if (cName.length() > 0) {
          try {
            clazz = Class.forName(cName);
            parserInstance = clazz.newInstance();
            if (parserInstance instanceof FTPFileParser) {
              if (log.isDetailed()) {logDetailed(BaseMessages.getString(PKG, "JobEntryFTP.DEBUG.Created.Other.Parser", cName));}
              factory.addParser((FTPFileParser)parserInstance);
            }
          } catch (Exception ignored) {
            if (log.isDebug()) {
              ignored.printStackTrace();
              logError(BaseMessages.getString(PKG, "JobEntryFTP.ERROR.Creating.Parser", cName));
            }
          }
        }
      }
    }
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:49,代码来源:JobEntryFTP.java


示例5: uploadFile

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
public String uploadFile(String localFileName, String remoteFileName) throws FTPException, IOException{
	return ftp.uploadFile(localFileName, remoteFileName);
}
 
开发者ID:knowpd,项目名称:p2p-file-sharing-system,代码行数:4,代码来源:PeerlessFtpClientSupport.java


示例6: downloadFile

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
public void downloadFile(String localFileName, String remoteFileName) throws FTPException, IOException{
	ftp.downloadFile(localFileName, remoteFileName);
}
 
开发者ID:knowpd,项目名称:p2p-file-sharing-system,代码行数:4,代码来源:PeerlessFtpClientSupport.java


示例7: hookInOtherParsers

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
/**
 * Hook in known parsers, and then those that have been specified in the variable ftp.file.parser.class.names
 *
 * @param ftpClient
 * @throws FTPException
 * @throws IOException
 */
protected void hookInOtherParsers( FTPClient ftpClient ) throws FTPException, IOException {
  if ( log.isDebug() ) {
    logDebug( BaseMessages.getString( PKG, "JobEntryFTP.DEBUG.Hooking.Parsers" ) );
  }
  String system = ftpClient.system();
  MVSFileParser parser = new MVSFileParser( log );
  if ( log.isDebug() ) {
    logDebug( BaseMessages.getString( PKG, "JobEntryFTP.DEBUG.Created.MVS.Parser" ) );
  }
  FTPFileFactory factory = new FTPFileFactory( system );
  if ( log.isDebug() ) {
    logDebug( BaseMessages.getString( PKG, "JobEntryFTP.DEBUG.Created.Factory" ) );
  }
  factory.addParser( parser );
  ftpClient.setFTPFileFactory( factory );
  if ( log.isDebug() ) {
    logDebug( BaseMessages.getString( PKG, "JobEntryFTP.DEBUG.Get.Variable.Space" ) );
  }
  VariableSpace vs = this.getVariables();
  if ( vs != null ) {
    if ( log.isDebug() ) {
      logDebug( BaseMessages.getString( PKG, "JobEntryFTP.DEBUG.Getting.Other.Parsers" ) );
    }
    String otherParserNames = vs.getVariable( "ftp.file.parser.class.names" );
    if ( otherParserNames != null ) {
      if ( log.isDebug() ) {
        logDebug( BaseMessages.getString( PKG, "JobEntryFTP.DEBUG.Creating.Parsers" ) );
      }
      String[] parserClasses = otherParserNames.split( "|" );
      String cName = null;
      Class<?> clazz = null;
      Object parserInstance = null;
      for ( int i = 0; i < parserClasses.length; i++ ) {
        cName = parserClasses[i].trim();
        if ( cName.length() > 0 ) {
          try {
            clazz = Class.forName( cName );
            parserInstance = clazz.newInstance();
            if ( parserInstance instanceof FTPFileParser ) {
              if ( log.isDetailed() ) {
                logDetailed( BaseMessages.getString( PKG, "JobEntryFTP.DEBUG.Created.Other.Parser", cName ) );
              }
              factory.addParser( (FTPFileParser) parserInstance );
            }
          } catch ( Exception ignored ) {
            if ( log.isDebug() ) {
              ignored.printStackTrace();
              logError( BaseMessages.getString( PKG, "JobEntryFTP.ERROR.Creating.Parser", cName ) );
            }
          }
        }
      }
    }
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:63,代码来源:JobEntryFTP.java


示例8: createAndSetUpFtpClient

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
FTPClient createAndSetUpFtpClient() throws IOException, FTPException {
  String realServerName = environmentSubstitute( serverName );
  String realServerPort = environmentSubstitute( serverPort );

  FTPClient ftpClient = createFtpClient();
  ftpClient.setRemoteAddr( InetAddress.getByName( realServerName ) );
  if ( !Utils.isEmpty( realServerPort ) ) {
    ftpClient.setRemotePort( Const.toInt( realServerPort, FTP_DEFAULT_PORT ) );
  }

  if ( !Utils.isEmpty( proxyHost ) ) {
    String realProxyHost = environmentSubstitute( proxyHost );
    ftpClient.setRemoteAddr( InetAddress.getByName( realProxyHost ) );
    if ( log.isDetailed() ) {
      logDetailed( BaseMessages.getString( PKG, "JobEntryFTPPUT.OpenedProxyConnectionOn", realProxyHost ) );
    }

    // FIXME: Proper default port for proxy
    int port = Const.toInt( environmentSubstitute( proxyPort ), FTP_DEFAULT_PORT );
    if ( port != 0 ) {
      ftpClient.setRemotePort( port );
    }
  } else {
    if ( log.isDetailed() ) {
      logDetailed( BaseMessages.getString( PKG, "JobEntryFTPPUT.OpenConnection", realServerName ) );
    }
  }

  // set activeConnection connectmode ...
  if ( activeConnection ) {
    ftpClient.setConnectMode( FTPConnectMode.ACTIVE );
    if ( log.isDetailed() ) {
      logDetailed( BaseMessages.getString( PKG, "JobFTPPUT.Log.SetActiveConnection" ) );
    }
  } else {
    ftpClient.setConnectMode( FTPConnectMode.PASV );
    if ( log.isDetailed() ) {
      logDetailed( BaseMessages.getString( PKG, "JobFTPPUT.Log.SetPassiveConnection" ) );
    }
  }

  // Set the timeout
  if ( timeout > 0 ) {
    ftpClient.setTimeout( timeout );
    if ( log.isDetailed() ) {
      logDetailed( BaseMessages.getString( PKG, "JobFTPPUT.Log.SetTimeout", "" + timeout ) );
    }
  }

  ftpClient.setControlEncoding( controlEncoding );
  if ( log.isDetailed() ) {
    logDetailed( BaseMessages.getString( PKG, "JobFTPPUT.Log.SetEncoding", controlEncoding ) );
  }

  // If socks proxy server was provided
  if ( !Utils.isEmpty( socksProxyHost ) ) {
    // if a port was provided
    if ( !Utils.isEmpty( socksProxyPort ) ) {
      FTPClient.initSOCKS( environmentSubstitute( socksProxyPort ), environmentSubstitute( socksProxyHost ) );
    } else { // looks like we have a host and no port
      throw new FTPException( BaseMessages.getString(
        PKG, "JobFTPPUT.SocksProxy.PortMissingException", environmentSubstitute( socksProxyHost ) ) );
    }
    // now if we have authentication information
    if ( !Utils.isEmpty( socksProxyUsername )
      && Utils.isEmpty( socksProxyPassword ) || Utils.isEmpty( socksProxyUsername )
      && !Utils.isEmpty( socksProxyPassword ) ) {
      // we have a username without a password or vica versa
      throw new FTPException( BaseMessages.getString(
        PKG, "JobFTPPUT.SocksProxy.IncompleteCredentials", environmentSubstitute( socksProxyHost ),
        getName() ) );
    }
  }

  return ftpClient;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:77,代码来源:JobEntryFTPPUT.java


示例9: hookInOtherParsers

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
/**
 * Hook in known parsers, and then those that have been specified in the variable ftp.file.parser.class.names
 *
 * @param ftpClient
 * @throws FTPException
 * @throws IOException
 */
protected void hookInOtherParsers( FTPClient ftpClient ) throws FTPException, IOException {
  if ( log.isDebug() ) {
    logDebug( BaseMessages.getString( PKG, "JobEntryFTP.DEBUG.Hooking.Parsers" ) );
  }
  String system = ftpClient.system();
  MVSFileParser parser = new MVSFileParser( log );
  if ( log.isDebug() ) {
    logDebug( BaseMessages.getString( PKG, "JobEntryFTP.DEBUG.Created.MVS.Parser" ) );
  }
  FTPFileFactory factory = new FTPFileFactory( system );
  if ( log.isDebug() ) {
    logDebug( BaseMessages.getString( PKG, "JobEntryFTP.DEBUG.Created.Factory" ) );
  }
  factory.addParser( parser );
  ftpClient.setFTPFileFactory( factory );
  if ( log.isDebug() ) {
    logDebug( BaseMessages.getString( PKG, "JobEntryFTP.DEBUG.Get.Variable.Space" ) );
  }
  VariableSpace vs = this.getVariables();
  if ( vs != null ) {
    if ( log.isDebug() ) {
      logDebug( BaseMessages.getString( PKG, "JobEntryFTP.DEBUG.Getting.Other.Parsers" ) );
    }
    String otherParserNames = vs.getVariable( "ftp.file.parser.class.names" );
    if ( otherParserNames != null ) {
      if ( log.isDebug() ) {
        logDebug( BaseMessages.getString( PKG, "JobEntryFTP.DEBUG.Creating.Parsers" ) );
      }
      String[] parserClasses = otherParserNames.split( "|" );
      String cName = null;
      Class<?> clazz = null;
      Object parserInstance = null;
      for ( int i = 0; i < parserClasses.length; i++ ) {
        cName = parserClasses[ i ].trim();
        if ( cName.length() > 0 ) {
          try {
            clazz = Class.forName( cName );
            parserInstance = clazz.newInstance();
            if ( parserInstance instanceof FTPFileParser ) {
              if ( log.isDetailed() ) {
                logDetailed( BaseMessages.getString( PKG, "JobEntryFTP.DEBUG.Created.Other.Parser", cName ) );
              }
              factory.addParser( (FTPFileParser) parserInstance );
            }
          } catch ( Exception ignored ) {
            if ( log.isDebug() ) {
              ignored.printStackTrace();
              logError( BaseMessages.getString( PKG, "JobEntryFTP.ERROR.Creating.Parser", cName ) );
            }
          }
        }
      }
    }
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:63,代码来源:JobEntryFTPPUT.java


示例10: connect

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
@Override
public void connect() throws IOException, FTPException {
  connected = true;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:5,代码来源:MockedFTPClient.java


示例11: delete

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
@Override
public void delete( String remoteFile ) throws IOException, FTPException {
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:4,代码来源:MockedFTPClient.java


示例12: login

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
@Override
public void login( String user, String password, String accountInfo ) throws IOException, FTPException {
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:4,代码来源:MockedFTPClient.java


示例13: mkdir

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
@Override
public void mkdir( String dir ) throws IOException, FTPException {
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:4,代码来源:MockedFTPClient.java


示例14: quit

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
@Override
public void quit() throws IOException, FTPException {
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:4,代码来源:MockedFTPClient.java


示例15: setRemoteHost

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
@Override
public void setRemoteHost( String remoteHost ) throws IOException, FTPException {
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:4,代码来源:MockedFTPClient.java


示例16: setRemoteAddr

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
@Override
public void setRemoteAddr( InetAddress remoteAddr ) throws FTPException {
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:4,代码来源:MockedFTPClient.java


示例17: system

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
@Override
public String system() throws IOException, FTPException {
  return "Wondows";
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:5,代码来源:MockedFTPClient.java


示例18: chdir

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
@Override
public void chdir( String dir ) throws IOException, FTPException {
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:4,代码来源:MockedFTPClient.java


示例19: setType

import com.enterprisedt.net.ftp.FTPException; //导入依赖的package包/类
@Override
public void setType( FTPTransferType type ) throws IOException, FTPException {
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:4,代码来源:MockedFTPClient.java



注:本文中的com.enterprisedt.net.ftp.FTPException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Approval类代码示例发布时间:2022-05-22
下一篇:
Java DocumentObjectBinder类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap