Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
9ebf0f88
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看板
提交
9ebf0f88
编写于
8月 20, 2009
作者:
A
alanb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6866804: (file) Path calls checkPermission insteadof checkXXX (sol)
Reviewed-by: sherman
上级
acd702cf
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
704 addition
and
33 deletion
+704
-33
src/solaris/classes/sun/nio/fs/UnixPath.java
src/solaris/classes/sun/nio/fs/UnixPath.java
+7
-32
src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java
...windows/classes/sun/nio/fs/WindowsFileAttributeViews.java
+1
-0
test/java/nio/file/Path/CheckPermissions.java
test/java/nio/file/Path/CheckPermissions.java
+695
-0
test/java/nio/file/Path/Misc.java
test/java/nio/file/Path/Misc.java
+1
-1
未找到文件。
src/solaris/classes/sun/nio/fs/UnixPath.java
浏览文件 @
9ebf0f88
...
@@ -65,9 +65,6 @@ class UnixPath
...
@@ -65,9 +65,6 @@ class UnixPath
// array of offsets of elements in path (created lazily)
// array of offsets of elements in path (created lazily)
private
volatile
int
[]
offsets
;
private
volatile
int
[]
offsets
;
// file permissions (created lazily)
private
volatile
FilePermission
[]
perms
;
UnixPath
(
UnixFileSystem
fs
,
byte
[]
path
)
{
UnixPath
(
UnixFileSystem
fs
,
byte
[]
path
)
{
this
.
fs
=
fs
;
this
.
fs
=
fs
;
this
.
path
=
path
;
this
.
path
=
path
;
...
@@ -768,45 +765,23 @@ class UnixPath
...
@@ -768,45 +765,23 @@ class UnixPath
}
}
}
}
// create file permissions used for read and write checks
private
void
checkReadOrWrite
(
boolean
checkRead
)
{
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
==
null
)
return
;
if
(
perms
==
null
)
{
synchronized
(
this
)
{
if
(
perms
==
null
)
{
FilePermission
[]
p
=
new
FilePermission
[
2
];
String
pathForPermCheck
=
getPathForPermissionCheck
();
p
[
0
]
=
new
FilePermission
(
pathForPermCheck
,
SecurityConstants
.
FILE_READ_ACTION
);
p
[
1
]
=
new
FilePermission
(
pathForPermCheck
,
SecurityConstants
.
FILE_WRITE_ACTION
);
perms
=
p
;
}
}
}
if
(
checkRead
)
{
sm
.
checkPermission
(
perms
[
0
]);
}
else
{
sm
.
checkPermission
(
perms
[
1
]);
}
}
void
checkRead
()
{
void
checkRead
()
{
checkReadOrWrite
(
true
);
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
!=
null
)
sm
.
checkRead
(
getPathForPermissionCheck
());
}
}
void
checkWrite
()
{
void
checkWrite
()
{
checkReadOrWrite
(
false
);
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
!=
null
)
sm
.
checkWrite
(
getPathForPermissionCheck
());
}
}
void
checkDelete
()
{
void
checkDelete
()
{
SecurityManager
sm
=
System
.
getSecurityManager
();
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
!=
null
)
{
if
(
sm
!=
null
)
// permission not cached
sm
.
checkDelete
(
getPathForPermissionCheck
());
sm
.
checkDelete
(
getPathForPermissionCheck
());
}
}
}
@Override
@Override
...
...
src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java
浏览文件 @
9ebf0f88
...
@@ -46,6 +46,7 @@ class WindowsFileAttributeViews {
...
@@ -46,6 +46,7 @@ class WindowsFileAttributeViews {
@Override
@Override
public
WindowsFileAttributes
readAttributes
()
throws
IOException
{
public
WindowsFileAttributes
readAttributes
()
throws
IOException
{
file
.
checkRead
();
try
{
try
{
return
WindowsFileAttributes
.
get
(
file
,
followLinks
);
return
WindowsFileAttributes
.
get
(
file
,
followLinks
);
}
catch
(
WindowsException
x
)
{
}
catch
(
WindowsException
x
)
{
...
...
test/java/nio/file/Path/CheckPermissions.java
0 → 100644
浏览文件 @
9ebf0f88
此差异已折叠。
点击以展开。
test/java/nio/file/Path/Misc.java
浏览文件 @
9ebf0f88
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
*/
*/
/* @test
/* @test
* @bug 4313887 6838333 686
6804
* @bug 4313887 6838333 686
7101
* @summary Unit test for java.nio.file.Path for miscellenous methods not
* @summary Unit test for java.nio.file.Path for miscellenous methods not
* covered by other tests
* covered by other tests
* @library ..
* @library ..
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录