mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-06 23:30:55 +03:00
can't throw exception, shit fails on windows
This commit is contained in:
@@ -15,6 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
package net.schmizz.sshj.xfer;
|
package net.schmizz.sshj.xfer;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@@ -26,6 +29,8 @@ import java.io.IOException;
|
|||||||
public class DefaultModeSetter
|
public class DefaultModeSetter
|
||||||
implements ModeSetter {
|
implements ModeSetter {
|
||||||
|
|
||||||
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setLastAccessedTime(File f, long t)
|
public void setLastAccessedTime(File f, long t)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
@@ -36,7 +41,7 @@ public class DefaultModeSetter
|
|||||||
public void setLastModifiedTime(File f, long t)
|
public void setLastModifiedTime(File f, long t)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
if (!f.setLastModified(t * 1000))
|
if (!f.setLastModified(t * 1000))
|
||||||
throw new IOException("Error setting last modified time for " + f);
|
log.warn("Could not set last modified time for {} to {}", f, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -49,7 +54,7 @@ public class DefaultModeSetter
|
|||||||
final boolean x = f.setExecutable(FilePermission.USR_X.isIn(perms),
|
final boolean x = f.setExecutable(FilePermission.USR_X.isIn(perms),
|
||||||
!(FilePermission.OTH_X.isIn(perms) || FilePermission.GRP_X.isIn(perms)));
|
!(FilePermission.OTH_X.isIn(perms) || FilePermission.GRP_X.isIn(perms)));
|
||||||
if (!(r && w && x))
|
if (!(r && w && x))
|
||||||
throw new IOException("Error setting permissions for " + f);
|
log.warn("Could not set permissions for {} to {}", f, Integer.toString(perms, 16));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
Reference in New Issue
Block a user