本文整理汇总了Java中org.globus.io.streams.GridFTPOutputStream类的典型用法代码示例。如果您正苦于以下问题:Java GridFTPOutputStream类的具体用法?Java GridFTPOutputStream怎么用?Java GridFTPOutputStream使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GridFTPOutputStream类属于org.globus.io.streams包,在下文中一共展示了GridFTPOutputStream类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doGetOutputStream
import org.globus.io.streams.GridFTPOutputStream; //导入依赖的package包/类
/**
* Creates an output stream to write the file content to.
*
* @param bAppend the b append
*
* @return the output stream
*
* @throws Exception the exception
*/
@Override
protected OutputStream doGetOutputStream(boolean bAppend) throws Exception {
// String Path = relPath;
log.debug("Creating FTP Output Stream to host:" + GsiFtpClientFactory.port + ":" + GsiFtpClientFactory.port + " Abs path:"
+ getName().getPath() + " Append:" + bAppend);
// if ( ! relPath.startsWith("/")) {
// Path = "/" + Path;
// log.warn("Relative path " + relPath + " doesn't start with /. Using:" + Path + " instead");
// }
return new GridFTPOutputStream(null, GsiFtpClientFactory.host, GsiFtpClientFactory.port, getName().getPath(), bAppend);
// log.debug("Creating FTP Output stream: Unimplemented");
// throw new Exception("Unimplemented");
// final FtpClient client = ftpFs.getClient();
// OutputStream out = null;
// if (bAppend)
// {
// out = client.appendFileStream(relPath);
// }
// else
// {
// out = client.storeFileStream(relPath);
// }
//
// if (out == null)
// {
// throw new FileSystemException("vfs.provider.ftp/output-error.debug", new Object[]
// {
// this.getName(),
// client.getReplyString()
// });
// }
//
// return new FtpOutputStream(client, out);
}
示例2: openUrl
import org.globus.io.streams.GridFTPOutputStream; //导入依赖的package包/类
protected OutputStream openUrl(GlobusURL url)
throws Exception {
String protocol = url.getProtocol();
if (protocol.equalsIgnoreCase("https")) {
return new GassOutputStream(_credential,
SelfAuthorization.getInstance(),
url.getHost(),
url.getPort(),
url.getPath(),
-1,
appendStdout);
} else if (protocol.equalsIgnoreCase("http")) {
return new HTTPOutputStream(url.getHost(),
url.getPort(),
url.getPath(),
-1,
appendStdout);
} else if (protocol.equalsIgnoreCase("gsiftp") ||
protocol.equalsIgnoreCase("gridftp")) {
return new GridFTPOutputStream(_credential,
HostAuthorization.getInstance(),
url.getHost(),
url.getPort(),
url.getPath(),
appendStdout,
true);
} else if (protocol.equalsIgnoreCase("ftp")) {
return new FTPOutputStream(url.getHost(),
url.getPort(),
url.getUser(),
url.getPwd(),
url.getPath(),
appendStdout);
} else {
throw new Exception("Protocol not supported: " + protocol);
}
}