本文整理汇总了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;未经允许,请勿转载。 |
请发表评论