Returns an array of strings with the file names in the directory represented by this file. The result is null if this file is not a directory. The entries . and .. representing the current and parent directory are not returned as part of the list. @return an array of str
()
| 964 | * @see java.lang.SecurityManager#checkRead(FileDescriptor) |
| 965 | */ |
| 966 | public java.lang.String[] list() { |
| 967 | // SecurityManager security = System.getSecurityManager(); |
| 968 | // if (security != null) { |
| 969 | // security.checkRead(path); |
| 970 | // } |
| 971 | |
| 972 | if (path.length() == 0) { |
| 973 | return null; |
| 974 | } |
| 975 | |
| 976 | byte[] bs = properPath(true); |
| 977 | if (!isDirectoryImpl(bs) || !existsImpl(bs) || isWriteOnlyImpl(bs)) { |
| 978 | return null; |
| 979 | } |
| 980 | |
| 981 | byte[][] implList = listImpl(bs); |
| 982 | if (implList == null) { |
| 983 | // empty list |
| 984 | return new String[0]; |
| 985 | } |
| 986 | String result[] = new String[implList.length]; |
| 987 | for (int index = 0; index < implList.length; index++) { |
| 988 | result[index] = Util.toUTF8String(implList[index]); |
| 989 | } |
| 990 | return result; |
| 991 | } |
| 992 | |
| 993 | /** |
| 994 | * Returns an array of files contained in the directory represented by this |
no test coverage detected