本文整理了Java中hudson.FilePath._chmod()
方法的一些代码示例,展示了FilePath._chmod()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FilePath._chmod()
方法的具体详情如下:
包路径:hudson.FilePath
类名称:FilePath
方法名:_chmod
[英]Run chmod via libc if we can, otherwise fall back to Ant.
[中]如果可以的话,通过libc运行chmod,否则就求助于Ant。
代码示例来源:origin: jenkinsci/jenkins
int mode = te.getMode() & 0777;
if (mode != 0 && !Functions.isWindows()) // be defensive
_chmod(f, mode);
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Reads from a tar stream and stores obtained files to the base dir.
*/
private static void readFromTar(String name, File baseDir, InputStream in) throws IOException {
TarInputStream t = new TarInputStream(in);
try {
TarEntry te;
while ((te = t.getNextEntry()) != null) {
File f = new File(baseDir,te.getName());
if(te.isDirectory()) {
f.mkdirs();
} else {
File parent = f.getParentFile();
if (parent != null) parent.mkdirs();
IOUtils.copy(t,f);
f.setLastModified(te.getModTime().getTime());
int mode = te.getMode()&0777;
if(mode!=0 && !Functions.isWindows()) // be defensive
_chmod(f,mode);
}
}
} catch(IOException e) {
throw new IOException2("Failed to extract "+name,e);
} finally {
t.close();
}
}
代码示例来源:origin: hudson/hudson-2.x
/**
* Reads from a tar stream and stores obtained files to the base dir.
*/
private static void readFromTar(String name, File baseDir, InputStream in) throws IOException {
TarInputStream t = new TarInputStream(in);
try {
TarEntry te;
while ((te = t.getNextEntry()) != null) {
File f = new File(baseDir,te.getName());
if(te.isDirectory()) {
f.mkdirs();
} else {
File parent = f.getParentFile();
if (parent != null) parent.mkdirs();
IOUtils.copy(t,f);
f.setLastModified(te.getModTime().getTime());
int mode = te.getMode()&0777;
if(mode!=0 && !Functions.isWindows()) // be defensive
_chmod(f,mode);
}
}
} catch(IOException e) {
throw new IOException2("Failed to extract "+name,e);
} finally {
t.close();
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
int mode = te.getMode() & 0777;
if (mode != 0 && !Functions.isWindows()) // be defensive
_chmod(f, mode);
内容来源于网络,如有侵权,请联系作者删除!