public Collection getContents()

in taverna-server-worker/src/main/java/org/apache/taverna/server/localworker/impl/DirectoryDelegate.java [72:100]


	public Collection<RemoteDirectoryEntry> getContents()
			throws RemoteException {
		List<RemoteDirectoryEntry> result = new ArrayList<>();
		for (String s : dir.list()) {
			if (s.equals(".") || s.equals(".."))
				continue;
			File f = new File(dir, s);
			RemoteDirectoryEntry entry;
			synchronized (localCache) {
				entry = (RemoteDirectoryEntry) localCache.get(s);
				if (f.isDirectory()) {
					if (entry == null || !(entry instanceof DirectoryDelegate)) {
						entry = new DirectoryDelegate(f, this);
						localCache.put(s, entry);
					}
				} else if (f.isFile()) {
					if (entry == null || !(entry instanceof FileDelegate)) {
						entry = new FileDelegate(f, this);
						localCache.put(s, entry);
					}
				} else {
					// not file or dir; skip...
					continue;
				}
			}
			result.add(entry);
		}
		return result;
	}