mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-29 12:35:19 +00:00
Added serialVersionUID to all Callables
This commit is contained in:
1 parent
19b31687c8
commit
b807845b9b
1 file changed
+29
@@ -543,6 +543,7 @@ public final class FilePath implements Serializable {
|
||||
*/
|
||||
public FilePath absolutize() throws IOException, InterruptedException {
|
||||
return new FilePath(channel,act(new FileCallable<String>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public String invoke(File f, VirtualChannel channel) throws IOException {
|
||||
return f.getAbsolutePath();
|
||||
}
|
||||
@@ -560,6 +561,7 @@ public final class FilePath implements Serializable {
|
||||
*/
|
||||
public void symlinkTo(final String target, final TaskListener listener) throws IOException, InterruptedException {
|
||||
act(new FileCallable<Void>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Void invoke(File f, VirtualChannel channel) throws IOException, InterruptedException {
|
||||
Util.createSymlink(f.getParentFile(),target,f.getName(),listener);
|
||||
return null;
|
||||
@@ -576,6 +578,7 @@ public final class FilePath implements Serializable {
|
||||
*/
|
||||
public String readLink() throws IOException, InterruptedException {
|
||||
return act(new FileCallable<String>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public String invoke(File f, VirtualChannel channel) throws IOException, InterruptedException {
|
||||
return Util.resolveSymlink(f);
|
||||
}
|
||||
@@ -884,6 +887,7 @@ public final class FilePath implements Serializable {
|
||||
* @since 1.482
|
||||
*/
|
||||
public static abstract class AbstractInterceptorCallableWrapper<T> implements DelegatingCallable<T, IOException> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final DelegatingCallable<T, IOException> callable;
|
||||
|
||||
@@ -960,6 +964,7 @@ public final class FilePath implements Serializable {
|
||||
*/
|
||||
public URI toURI() throws IOException, InterruptedException {
|
||||
return act(new FileCallable<URI>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public URI invoke(File f, VirtualChannel channel) {
|
||||
return f.toURI();
|
||||
}
|
||||
@@ -971,6 +976,7 @@ public final class FilePath implements Serializable {
|
||||
*/
|
||||
public void mkdirs() throws IOException, InterruptedException {
|
||||
if(!act(new FileCallable<Boolean>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Boolean invoke(File f, VirtualChannel channel) throws IOException, InterruptedException {
|
||||
if(f.mkdirs() || f.exists())
|
||||
return true; // OK
|
||||
@@ -989,6 +995,7 @@ public final class FilePath implements Serializable {
|
||||
*/
|
||||
public void deleteRecursive() throws IOException, InterruptedException {
|
||||
act(new FileCallable<Void>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Void invoke(File f, VirtualChannel channel) throws IOException {
|
||||
Util.deleteRecursive(f);
|
||||
return null;
|
||||
@@ -1001,6 +1008,7 @@ public final class FilePath implements Serializable {
|
||||
*/
|
||||
public void deleteContents() throws IOException, InterruptedException {
|
||||
act(new FileCallable<Void>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Void invoke(File f, VirtualChannel channel) throws IOException {
|
||||
Util.deleteContentsRecursive(f);
|
||||
return null;
|
||||
@@ -1094,6 +1102,7 @@ public final class FilePath implements Serializable {
|
||||
public FilePath createTempFile(final String prefix, final String suffix) throws IOException, InterruptedException {
|
||||
try {
|
||||
return new FilePath(this,act(new FileCallable<String>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public String invoke(File dir, VirtualChannel channel) throws IOException {
|
||||
File f = File.createTempFile(prefix, suffix, dir);
|
||||
return f.getName();
|
||||
@@ -1149,6 +1158,7 @@ public final class FilePath implements Serializable {
|
||||
public FilePath createTextTempFile(final String prefix, final String suffix, final String contents, final boolean inThisDirectory) throws IOException, InterruptedException {
|
||||
try {
|
||||
return new FilePath(channel,act(new FileCallable<String>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public String invoke(File dir, VirtualChannel channel) throws IOException {
|
||||
if(!inThisDirectory)
|
||||
dir = new File(System.getProperty("java.io.tmpdir"));
|
||||
@@ -1191,6 +1201,7 @@ public final class FilePath implements Serializable {
|
||||
public FilePath createTempDir(final String prefix, final String suffix) throws IOException, InterruptedException {
|
||||
try {
|
||||
return new FilePath(this,act(new FileCallable<String>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public String invoke(File dir, VirtualChannel channel) throws IOException {
|
||||
File f = File.createTempFile(prefix, suffix, dir);
|
||||
f.delete();
|
||||
@@ -1210,6 +1221,7 @@ public final class FilePath implements Serializable {
|
||||
*/
|
||||
public boolean delete() throws IOException, InterruptedException {
|
||||
act(new FileCallable<Void>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Void invoke(File f, VirtualChannel channel) throws IOException {
|
||||
Util.deleteFile(f);
|
||||
return null;
|
||||
@@ -1223,6 +1235,7 @@ public final class FilePath implements Serializable {
|
||||
*/
|
||||
public boolean exists() throws IOException, InterruptedException {
|
||||
return act(new FileCallable<Boolean>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Boolean invoke(File f, VirtualChannel channel) throws IOException {
|
||||
return f.exists();
|
||||
}
|
||||
@@ -1238,6 +1251,7 @@ public final class FilePath implements Serializable {
|
||||
*/
|
||||
public long lastModified() throws IOException, InterruptedException {
|
||||
return act(new FileCallable<Long>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Long invoke(File f, VirtualChannel channel) throws IOException {
|
||||
return f.lastModified();
|
||||
}
|
||||
@@ -1289,6 +1303,7 @@ public final class FilePath implements Serializable {
|
||||
*/
|
||||
public boolean isDirectory() throws IOException, InterruptedException {
|
||||
return act(new FileCallable<Boolean>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Boolean invoke(File f, VirtualChannel channel) throws IOException {
|
||||
return f.isDirectory();
|
||||
}
|
||||
@@ -1302,6 +1317,7 @@ public final class FilePath implements Serializable {
|
||||
*/
|
||||
public long length() throws IOException, InterruptedException {
|
||||
return act(new FileCallable<Long>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Long invoke(File f, VirtualChannel channel) throws IOException {
|
||||
return f.length();
|
||||
}
|
||||
@@ -1326,6 +1342,7 @@ public final class FilePath implements Serializable {
|
||||
public void chmod(final int mask) throws IOException, InterruptedException {
|
||||
if(!isUnix() || mask==-1) return;
|
||||
act(new FileCallable<Void>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Void invoke(File f, VirtualChannel channel) throws IOException {
|
||||
_chmod(f, mask);
|
||||
|
||||
@@ -1376,6 +1393,7 @@ public final class FilePath implements Serializable {
|
||||
public int mode() throws IOException, InterruptedException, PosixException {
|
||||
if(!isUnix()) return -1;
|
||||
return act(new FileCallable<Integer>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Integer invoke(File f, VirtualChannel channel) throws IOException {
|
||||
return IOUtils.mode(f);
|
||||
}
|
||||
@@ -1422,6 +1440,7 @@ public final class FilePath implements Serializable {
|
||||
throw new IllegalArgumentException("Non-serializable filter of " + filter.getClass());
|
||||
}
|
||||
return act(new FileCallable<List<FilePath>>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public List<FilePath> invoke(File f, VirtualChannel channel) throws IOException {
|
||||
File[] children = f.listFiles(filter);
|
||||
if(children ==null) return null;
|
||||
@@ -1474,6 +1493,7 @@ public final class FilePath implements Serializable {
|
||||
*/
|
||||
public FilePath[] list(final String includes, final String excludes, final boolean defaultExcludes) throws IOException, InterruptedException {
|
||||
return act(new FileCallable<FilePath[]>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public FilePath[] invoke(File f, VirtualChannel channel) throws IOException {
|
||||
String[] files = glob(f, includes, excludes, defaultExcludes);
|
||||
|
||||
@@ -1511,6 +1531,7 @@ public final class FilePath implements Serializable {
|
||||
|
||||
final Pipe p = Pipe.createRemoteToLocal();
|
||||
channel.callAsync(new Callable<Void,IOException>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Void call() throws IOException {
|
||||
FileInputStream fis=null;
|
||||
try {
|
||||
@@ -1562,6 +1583,7 @@ public final class FilePath implements Serializable {
|
||||
}
|
||||
|
||||
return channel.call(new Callable<OutputStream,IOException>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public OutputStream call() throws IOException {
|
||||
File f = new File(remote).getAbsoluteFile();
|
||||
f.getParentFile().mkdirs();
|
||||
@@ -1580,6 +1602,7 @@ public final class FilePath implements Serializable {
|
||||
*/
|
||||
public void write(final String content, final String encoding) throws IOException, InterruptedException {
|
||||
act(new FileCallable<Void>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Void invoke(File f, VirtualChannel channel) throws IOException {
|
||||
f.getParentFile().mkdirs();
|
||||
FileOutputStream fos = new FileOutputStream(f);
|
||||
@@ -1599,6 +1622,7 @@ public final class FilePath implements Serializable {
|
||||
*/
|
||||
public String digest() throws IOException, InterruptedException {
|
||||
return act(new FileCallable<String>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public String invoke(File f, VirtualChannel channel) throws IOException {
|
||||
return Util.getDigestOf(new FileInputStream(f));
|
||||
}
|
||||
@@ -1614,6 +1638,7 @@ public final class FilePath implements Serializable {
|
||||
throw new IOException("renameTo target must be on the same host");
|
||||
}
|
||||
act(new FileCallable<Void>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Void invoke(File f, VirtualChannel channel) throws IOException {
|
||||
f.renameTo(new File(target.remote));
|
||||
return null;
|
||||
@@ -1631,6 +1656,7 @@ public final class FilePath implements Serializable {
|
||||
throw new IOException("pullUpTo target must be on the same host");
|
||||
}
|
||||
act(new FileCallable<Void>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Void invoke(File f, VirtualChannel channel) throws IOException {
|
||||
File t = new File(target.getRemote());
|
||||
|
||||
@@ -1783,6 +1809,7 @@ public final class FilePath implements Serializable {
|
||||
if(this.channel==target.channel) {
|
||||
// local to local copy.
|
||||
return act(new FileCallable<Integer>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Integer invoke(File base, VirtualChannel channel) throws IOException {
|
||||
if(!base.exists()) return 0;
|
||||
assert target.channel==null;
|
||||
@@ -1825,6 +1852,7 @@ public final class FilePath implements Serializable {
|
||||
final Pipe pipe = Pipe.createLocalToRemote();
|
||||
|
||||
Future<Void> future = target.actAsync(new FileCallable<Void>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Void invoke(File f, VirtualChannel channel) throws IOException {
|
||||
try {
|
||||
readFromTar(remote+'/'+fileMask, f,TarCompression.GZIP.extract(pipe.getIn()));
|
||||
@@ -1846,6 +1874,7 @@ public final class FilePath implements Serializable {
|
||||
final Pipe pipe = Pipe.createRemoteToLocal();
|
||||
|
||||
Future<Integer> future = actAsync(new FileCallable<Integer>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public Integer invoke(File f, VirtualChannel channel) throws IOException {
|
||||
try {
|
||||
return writeToTar(f,fileMask,excludes,TarCompression.GZIP.compress(pipe.getOut()));
|
||||
|
||||
Reference in new issue
Block a user