Chmod不适用于VIRTUAL SFTP服务器

时间:2017-05-09 10:18:52

标签: java sftp file-permissions jsch chmod

以下是我用于chmod的代码

channelSftp.cd("test");
channelSftp.mkdir("8696");
channelSftp.chmod(511, "8696");

当我尝试在sftp虚拟服务器中chmod一个文件夹时,这是堆栈跟踪...

May 9, 2017 5:31:53 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2339 ms
2: No such file or directory
com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2873)
com.jcraft.jsch.ChannelSftp._setStat(ChannelSftp.java:2418)
com.jcraft.jsch.ChannelSftp.chmod(ChannelSftp.java:2085)
automate.turbosite.Automate.SFTPCreateFolder(Automate.java:208)
automate.turbosite.Automate.initiate(Automate.java:304)
automate.turbosite.AutomateServlet.doGet(AutomateServlet.java:51)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
java.lang.Thread.run(Thread.java:662)

但是当它是真正的SFTP服务器而不是虚拟SFTP服务器时,它也会起作用。

如果它是虚拟SFTP服务器,在为文件执行chmod时没有收到任何错误,但是当我尝试为文件夹(目录)执行chmod时它会出现异常并且它说没有这样的文件或目录但是你可以看到我在前一行使用mkdir创建了该目录)

0 个答案:

没有答案