Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
b807845b
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b807845b
编写于
1月 20, 2013
作者:
C
Christoph Kutzinski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added serialVersionUID to all Callables
上级
19b31687
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
29 addition
and
0 deletion
+29
-0
core/src/main/java/hudson/FilePath.java
core/src/main/java/hudson/FilePath.java
+29
-0
未找到文件。
core/src/main/java/hudson/FilePath.java
浏览文件 @
b807845b
...
...
@@ -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
()));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录