mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-09 18:08:31 +00:00
8026876: (fs) Build issue with src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java
Reviewed-by: psandoz
This commit is contained in:
parent
467adb4a7c
commit
d367fc0c17
@ -46,11 +46,14 @@ class SolarisUserDefinedFileAttributeView
|
||||
|
||||
private byte[] nameAsBytes(UnixPath file, String name) throws IOException {
|
||||
byte[] bytes = Util.toBytes(name);
|
||||
// "", "." and ".." not allowed
|
||||
if ((bytes.length == 0 || bytes[0] == '.') &&
|
||||
((bytes.length <= 1 || (bytes.length == 2 && bytes[1] == '.')) {
|
||||
throw new FileSystemException(file.getPathForExceptionMessage(),
|
||||
null, "'" + name + "' is not a valid name");
|
||||
// "", "." and ".." not allowed
|
||||
if (bytes.length == 0 || bytes[0] == '.') {
|
||||
if (bytes.length <= 1 ||
|
||||
(bytes.length == 2 && bytes[1] == '.'))
|
||||
{
|
||||
throw new FileSystemException(file.getPathForExceptionMessage(),
|
||||
null, "'" + name + "' is not a valid name");
|
||||
}
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user