Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
cd024bb1
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cd024bb1
编写于
3月 28, 2011
作者:
K
ksrini
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7031166: (pack200) tools/pack200/CommandLineTests.java fail with testsdk on RO filesystem
Reviewed-by: alanb
上级
60cd59d2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
11 addition
and
42 deletion
+11
-42
test/tools/pack200/CommandLineTests.java
test/tools/pack200/CommandLineTests.java
+2
-2
test/tools/pack200/TimeStamp.java
test/tools/pack200/TimeStamp.java
+1
-1
test/tools/pack200/Utils.java
test/tools/pack200/Utils.java
+8
-39
未找到文件。
test/tools/pack200/CommandLineTests.java
浏览文件 @
cd024bb1
...
@@ -120,9 +120,9 @@ public class CommandLineTests {
...
@@ -120,9 +120,9 @@ public class CommandLineTests {
// make a backup copy for re-use
// make a backup copy for re-use
File
bakFile
=
new
File
(
f
.
getName
()
+
".bak"
);
File
bakFile
=
new
File
(
f
.
getName
()
+
".bak"
);
if
(!
bakFile
.
exists
())
{
// backup
if
(!
bakFile
.
exists
())
{
// backup
Utils
.
copyFile
(
f
.
getAbsoluteFile
(),
bakFile
.
getAbsoluteFile
()
);
Utils
.
copyFile
(
f
,
bakFile
);
}
else
{
// restore
}
else
{
// restore
Utils
.
copyFile
(
bakFile
.
getAbsoluteFile
(),
f
.
getAbsoluteFile
()
);
Utils
.
copyFile
(
bakFile
,
f
);
}
}
cmdsList
.
clear
();
cmdsList
.
clear
();
cmdsList
.
add
(
Utils
.
getPack200Cmd
());
cmdsList
.
add
(
Utils
.
getPack200Cmd
());
...
...
test/tools/pack200/TimeStamp.java
浏览文件 @
cd024bb1
...
@@ -56,7 +56,7 @@ public class TimeStamp {
...
@@ -56,7 +56,7 @@ public class TimeStamp {
// make a local copy of our test file
// make a local copy of our test file
File
srcFile
=
Utils
.
locateJar
(
"golden.jar"
);
File
srcFile
=
Utils
.
locateJar
(
"golden.jar"
);
File
goldenFile
=
new
File
(
"golden.jar"
);
File
goldenFile
=
new
File
(
"golden.jar"
);
Utils
.
copyFile
(
srcFile
,
goldenFile
.
getAbsoluteFile
()
);
Utils
.
copyFile
(
srcFile
,
goldenFile
);
JarFile
goldenJarFile
=
new
JarFile
(
goldenFile
);
JarFile
goldenJarFile
=
new
JarFile
(
goldenFile
);
File
packFile
=
new
File
(
"golden.pack"
);
File
packFile
=
new
File
(
"golden.pack"
);
...
...
test/tools/pack200/Utils.java
浏览文件 @
cd024bb1
...
@@ -21,18 +21,18 @@
...
@@ -21,18 +21,18 @@
* questions.
* questions.
*/
*/
import
java.nio.file.Path
;
import
java.io.BufferedReader
;
import
java.io.BufferedReader
;
import
java.io.ByteArrayOutputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.Closeable
;
import
java.io.Closeable
;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileFilter
;
import
java.io.FileFilter
;
import
java.io.FileInputStream
;
import
java.io.FileOutputStream
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.io.InputStreamReader
;
import
java.io.PrintStream
;
import
java.io.PrintStream
;
import
java.nio.
channels.FileChannel
;
import
java.nio.
file.Files
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Collections
;
...
@@ -44,6 +44,8 @@ import java.util.jar.Pack200;
...
@@ -44,6 +44,8 @@ import java.util.jar.Pack200;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipFile
;
import
java.util.zip.ZipFile
;
import
static
java
.
nio
.
file
.
StandardCopyOption
.*;
/**
/**
*
*
* @author ksrini
* @author ksrini
...
@@ -180,45 +182,12 @@ class Utils {
...
@@ -180,45 +182,12 @@ class Utils {
}
}
};
};
private
static
void
setFileAttributes
(
File
src
,
File
dst
)
throws
IOException
{
dst
.
setExecutable
(
src
.
canExecute
());
dst
.
setReadable
(
src
.
canRead
());
dst
.
setWritable
(
src
.
canWrite
());
dst
.
setLastModified
(
src
.
lastModified
());
}
static
void
copyFile
(
File
src
,
File
dst
)
throws
IOException
{
static
void
copyFile
(
File
src
,
File
dst
)
throws
IOException
{
if
(
src
.
isDirectory
())
{
Path
parent
=
dst
.
toPath
().
getParent
();
dst
.
mkdirs
();
if
(
parent
!=
null
)
{
setFileAttributes
(
src
,
dst
);
Files
.
createDirectories
(
parent
);
return
;
}
else
{
File
baseDirFile
=
dst
.
getParentFile
();
if
(!
baseDirFile
.
exists
())
{
baseDirFile
.
mkdirs
();
}
}
FileInputStream
in
=
null
;
FileOutputStream
out
=
null
;
FileChannel
srcChannel
=
null
;
FileChannel
dstChannel
=
null
;
try
{
in
=
new
FileInputStream
(
src
);
out
=
new
FileOutputStream
(
dst
);
srcChannel
=
in
.
getChannel
();
dstChannel
=
out
.
getChannel
();
long
retval
=
srcChannel
.
transferTo
(
0
,
src
.
length
(),
dstChannel
);
if
(
src
.
length
()
!=
dst
.
length
())
{
throw
new
IOException
(
"file copy failed for "
+
src
);
}
}
finally
{
close
(
srcChannel
);
close
(
dstChannel
);
close
(
in
);
close
(
out
);
}
}
setFileAttributes
(
src
,
dst
);
Files
.
copy
(
src
.
toPath
(),
dst
.
toPath
(),
COPY_ATTRIBUTES
,
REPLACE_EXISTING
);
}
}
static
String
baseName
(
File
file
,
String
extension
)
{
static
String
baseName
(
File
file
,
String
extension
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录