loaded files in alphabetical order
Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/4e9487b2 Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/4e9487b2 Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/4e9487b2 Branch: refs/heads/MARMOTTA-584 Commit: 4e9487b259dcb8b490f2d00c7804fcc67e2a1cd8 Parents: d71cf79 Author: Sergio Fernández <[email protected]> Authored: Mon Jun 6 13:11:42 2016 +0200 Committer: Sergio Fernández <[email protected]> Committed: Mon Jun 6 13:11:42 2016 +0200 ---------------------------------------------------------------------- .../apache/marmotta/loader/core/MarmottaLoader.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/marmotta/blob/4e9487b2/loader/marmotta-loader-core/src/main/java/org/apache/marmotta/loader/core/MarmottaLoader.java ---------------------------------------------------------------------- diff --git a/loader/marmotta-loader-core/src/main/java/org/apache/marmotta/loader/core/MarmottaLoader.java b/loader/marmotta-loader-core/src/main/java/org/apache/marmotta/loader/core/MarmottaLoader.java index e1788f7..f7f9349 100644 --- a/loader/marmotta-loader-core/src/main/java/org/apache/marmotta/loader/core/MarmottaLoader.java +++ b/loader/marmotta-loader-core/src/main/java/org/apache/marmotta/loader/core/MarmottaLoader.java @@ -176,9 +176,6 @@ public class MarmottaLoader { } } - - - /** * Load data from the reader given as first argument into the handler given as second argument. * @@ -254,7 +251,6 @@ public class MarmottaLoader { load(in, handler, format); } - /** * Load data from the reader given as first argument into the handler given as second argument. * @@ -269,23 +265,24 @@ public class MarmottaLoader { public void loadDirectory(File directory, LoaderHandler handler, RDFFormat format, String compression) throws RDFParseException, IOException { log.info("loading files in directory {} ...", directory); if(directory.exists() && directory.isDirectory()) { - for(File f : directory.listFiles(new DirectoryFilter())) { + final List<File> files = Arrays.asList(directory.listFiles(new DirectoryFilter())); //TODO: follow subdirectories + Collections.sort(files); //TODO: somewhere there should be a helper to get them natively ordered from the fs + for(File f : files) { try { if(isArchive(f)) { loadArchive(f, handler, format); } else { - loadFile(f, handler,format,compression); + loadFile(f, handler, format, compression); } } catch (RDFParseException | IOException | ArchiveException e) { log.warn("error importing file {}: {}", f, e.getMessage()); } } } else { - throw new RDFParseException("could not load files from directory "+directory+": it does not exist or is not a directory"); + throw new RDFParseException("could not load files from directory " + directory + ": it does not exist or is not a directory"); } } - public void loadArchive(File archive, LoaderHandler handler, RDFFormat format) throws RDFParseException, IOException, ArchiveException { log.info("loading files in archive {} ...", archive);
