当前位置: 首页 > news >正文

长沙做网站建设的dream chaser wordpress

长沙做网站建设的,dream chaser wordpress,河源市网站建设公司,什么设计师最吃香我有一个SFTP问题(WindowsWinSSHD).我尝试用Apache Commons VFS在一个文件夹中写一个文件.在本地SFTP上我没有上传的问题,但在第二个SFTP上我总是得到以下错误.FTP看起来像这样#xff1a;我需要上传到文件夹“alis”.奇怪的是它没有User / Group和770权限.但是,使用FileZilla…我有一个SFTP问题(WindowsWinSSHD).我尝试用Apache Commons VFS在一个文件夹中写一个文件.在本地SFTP上我没有上传的问题,但在第二个SFTP上我总是得到以下错误.FTP看起来像这样我需要上传到文件夹“alis”.奇怪的是它没有User / Group和770权限.但是,使用FileZilla文件上传工作正常(使用相同的登录).在文件夹“alis”上执行“manager.resolveFile()”(我尝试上传到此文件夹)并打印“.getType()”我获取信息“文件”而不是预期的“文件夹”.有没有人知道为什么VFS会将文件夹识别为文件或为什么上传不起作用将文件上载到SFTP时的例外情况Exception in thread main java.lang.RuntimeException: org.apache.commons.vfs2.FileSystemException: Could not copy file:///D:/Test/test.txt to sftp://user:***host/.../alis/test.txt.at test.Test.upload(Test.java:77)at test.Test.main(Test.java:22)Caused by: org.apache.commons.vfs2.FileSystemException: Could not copy file:///D:/Test/test.txt to sftp://user:***host/.../alis/test.txt.at org.apache.commons.vfs2.provider.AbstractFileObject.copyFrom(AbstractFileObject.java:1062)at test.Test.upload(Test.java:73)... 1 moreCaused by: org.apache.commons.vfs2.FileSystemException: Could not create folder sftp://user:***host/.../alis because it already exists and is a file.at org.apache.commons.vfs2.provider.AbstractFileObject.createFolder(AbstractFileObject.java:968)at org.apache.commons.vfs2.provider.AbstractFileObject.getOutputStream(AbstractFileObject.java:1424)at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream(DefaultFileContent.java:461)at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream(DefaultFileContent.java:441)at org.apache.commons.vfs2.FileUtil.copyContent(FileUtil.java:111)at org.apache.commons.vfs2.provider.AbstractFileObject.copyFrom(AbstractFileObject.java:1053)... 2 more源代码:(运行示例,您需要“jsch-0.1.50.jar”)import java.io.File;import org.apache.commons.vfs2.FileObject;import org.apache.commons.vfs2.FileSystemException;import org.apache.commons.vfs2.FileSystemOptions;import org.apache.commons.vfs2.Selectors;import org.apache.commons.vfs2.impl.StandardFileSystemManager;import org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder;/**** author thbe*/public class Test {/*** param args the command line arguments*/public static void main(String[] args) {upload(host, user, password, D:/Test/test.txt, /../alis/test.txt);}public static FileSystemOptions createDefaultOptions()throws FileSystemException {// Create SFTP optionsFileSystemOptions opts new FileSystemOptions();// SSH Key checkingSftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(opts, no);// Root directory set to user homeSftpFileSystemConfigBuilder.getInstance().setUserDirIsRoot(opts, true);// Timeout is count by MillisecondsSftpFileSystemConfigBuilder.getInstance().setTimeout(opts, 10000);SftpFileSystemConfigBuilder.getInstance().setPreferredAuthentications(opts, publickey,keyboard-interactive,password);return opts;}public static void upload(String hostName, String username,String password, String localFilePath, String remoteFilePath) {File f new File(localFilePath);if (!f.exists()) {throw new RuntimeException(Error. Local file not found);}StandardFileSystemManager manager new StandardFileSystemManager();try {manager.init();// Create local file objectFileObject localFile manager.resolveFile(f.getAbsolutePath());System.out.println(open remote File);FileObject remoteFile manager.resolveFile(createConnectionString(hostName, username, password,remoteFilePath), createDefaultOptions());System.out.println(exists:remoteFile.exists());System.out.println(type:remoteFile.getType());System.out.println(URL:remoteFile.getURL());System.out.println(copy to remote File);remoteFile.copyFrom(localFile, Selectors.SELECT_SELF);System.out.println(File upload success);} catch (Exception e) {throw new RuntimeException(e);} finally {manager.close();}}public static String createConnectionString(String hostName,String username, String password, String remoteFilePath) {// result: sftp://user:123456domainname.com/resume.pdfreturn sftp:// username : password hostName / remoteFilePath;}}
http://www.zqtcl.cn/news/710080/

相关文章:

  • 成都高新区规划建设局网站网络营销方式有哪些?举例说明
  • 国家企业信用公信系统入口seo服务
  • 个人网站网页模板室内装修设计自学软件
  • 什么网站可以做告白的网页网站模板套用湖南岚鸿
  • 膜结构网站推广怎么做怎样把网站上传到空间
  • 三维网站是怎么做的商城网站 运营
  • 程序员网站开发框架无锡网络公司网站建设app微信公众号平
  • 中关村网站建设网络营销策划书范文
  • 电商网站建设与课程设计科技网站模版
  • 建设部网站资质漳州最专业的网站建设公司
  • 网站建设需求和页面需求怎么提一个静态网站怎么做
  • 宝塔wordpress广州网站营销seo
  • 甘肃城乡建设厅网站首页发布公司信息的网站
  • 工信部网站备案查询 手机凡科网微信小程序制作
  • 一站多通怎么做网站网站推广工具 刷链接
  • 学生做网站的工作室网络舆情监测与研判考试重点
  • 做网站去哪个公司好广告创意设计论文
  • 20m带宽做网站够用吗win7创建wordpress
  • qq音乐怎么做mp3下载网站发卡网站建设方案
  • 做cpc不做网站可以吗网站跳出率
  • 公司网站变更域名有了域名就可以做网站了吗
  • 网站建设推广营销策划做外贸网站需要注册公司吗
  • 可信赖的赣州网站建设做羽毛球网站
  • 如何找网站做推广wordpress登录及注册
  • 韩国美容网站 模板wordpress中英文
  • 为什么邮箱突然进不去了总提示正在进入不安全网站wordpress需注册访问
  • 建网站哪家最好山东泰安房价
  • wordpress4.9+多站点网络推广公司联系昔年下拉
  • 西安seo网站关键词优化罗田县建设局网站
  • 北京网站建设 shwllnmp新手 wordpress