8261183: Follow on to Make lists of normal filenames
Reviewed-by: alanb, rriggs, rhalade
This commit is contained in:
parent
40ef00cebf
commit
2fcd920adc
@ -1134,14 +1134,7 @@ public class File
|
||||
* the directory
|
||||
*/
|
||||
public String[] list() {
|
||||
SecurityManager security = System.getSecurityManager();
|
||||
if (security != null) {
|
||||
security.checkRead(path);
|
||||
}
|
||||
if (isInvalid()) {
|
||||
return null;
|
||||
}
|
||||
return fs.list(this);
|
||||
return normalizedList();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1161,8 +1154,15 @@ public class File
|
||||
* the directory
|
||||
*/
|
||||
private final String[] normalizedList() {
|
||||
String[] s = list();
|
||||
if (getClass() != File.class) {
|
||||
SecurityManager security = System.getSecurityManager();
|
||||
if (security != null) {
|
||||
security.checkRead(path);
|
||||
}
|
||||
if (isInvalid()) {
|
||||
return null;
|
||||
}
|
||||
String[] s = fs.list(this);
|
||||
if (s != null && getClass() != File.class) {
|
||||
String[] normalized = new String[s.length];
|
||||
for (int i = 0; i < s.length; i++) {
|
||||
normalized[i] = fs.normalize(s[i]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user