MCPcopy Create free account
hub / github.com/davidgiven/luje / list

Method list

lib/java/io/File.java:966–991  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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

Callers 1

listFilesMethod · 0.95

Calls 12

properPathMethod · 0.95
isDirectoryImplMethod · 0.95
existsImplMethod · 0.95
isWriteOnlyImplMethod · 0.95
listImplMethod · 0.95
toUTF8StringMethod · 0.95
toStringMethod · 0.95
addMethod · 0.95
toArrayMethod · 0.95
sizeMethod · 0.95
lengthMethod · 0.65
acceptMethod · 0.65

Tested by

no test coverage detected