@Override public FileStatus getFileStatus(Path f) throws IOException { final File path = pathToFile(f); if (path.exists()) { return new LocalFileStatus(path, this); } else { throw new FileNotFoundException("File " + f + " does not exist or the user running " + "Flink ('" + System.getProperty("user.name") + "') has insufficient permissions to access it."); } }
@Override public FileStatus getFileStatus(Path f) throws IOException { LocalFileStatus status = (LocalFileStatus) super.getFileStatus(f); return new LocalFileStatus(status.getFile(), this); }
@Override public FileStatus[] listStatus(final Path f) throws IOException { final File localf = pathToFile(f); FileStatus[] results; if (!localf.exists()) { return null; } if (localf.isFile()) { return new FileStatus[] { new LocalFileStatus(localf, this) }; } final String[] names = localf.list(); if (names == null) { return null; } results = new FileStatus[names.length]; for (int i = 0; i < names.length; i++) { results[i] = getFileStatus(new Path(f, names[i])); } return results; }
@Override public FileStatus[] listStatus(Path f) throws IOException { FileStatus[] stati = super.listStatus(f); LocalFileStatus[] newStati = new LocalFileStatus[stati.length]; for (int i = 0; i < stati.length; i++) { newStati[i] = new LocalFileStatus(((LocalFileStatus) stati[i]).getFile(), this); } return newStati; }
@Override public FileStatus getFileStatus(Path f) throws IOException { final File path = pathToFile(f); if (path.exists()) { return new LocalFileStatus(path, this); } else { throw new FileNotFoundException("File " + f + " does not exist or the user running " + "Flink ('" + System.getProperty("user.name") + "') has insufficient permissions to access it."); } }
@Override public FileStatus getFileStatus(Path f) throws IOException { final File path = pathToFile(f); if (path.exists()) { return new LocalFileStatus(path, this); } else { throw new FileNotFoundException("File " + f + " does not exist or the user running " + "Flink ('" + System.getProperty("user.name") + "') has insufficient permissions to access it."); } }
@Override public FileStatus[] listStatus(final Path f) throws IOException { final File localf = pathToFile(f); FileStatus[] results; if (!localf.exists()) { return null; } if (localf.isFile()) { return new FileStatus[] { new LocalFileStatus(localf, this) }; } final String[] names = localf.list(); if (names == null) { return null; } results = new FileStatus[names.length]; for (int i = 0; i < names.length; i++) { results[i] = getFileStatus(new Path(f, names[i])); } return results; }
@Override public FileStatus[] listStatus(final Path f) throws IOException { final File localf = pathToFile(f); FileStatus[] results; if (!localf.exists()) { return null; } if (localf.isFile()) { return new FileStatus[] { new LocalFileStatus(localf, this) }; } final String[] names = localf.list(); if (names == null) { return null; } results = new FileStatus[names.length]; for (int i = 0; i < names.length; i++) { results[i] = getFileStatus(new Path(f, names[i])); } return results; }