當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。