当前位置: 首页>>代码示例>>Java>>正文


Java GridFTPOutputStream类代码示例

本文整理汇总了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);
}
 
开发者ID:clstoulouse,项目名称:motu,代码行数:49,代码来源:GsiFtpFileObject.java

示例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);
}
   }
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:38,代码来源:AbstractJobManager.java


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