private static PageArray openPageArray(int pageSize, File[] files, FileFactory factory, EnumSet<OpenOption> options) throws IOException { checkPageSize(pageSize); if (!options.contains(OpenOption.CREATE)) { for (File file : files) { if (!file.exists()) { throw new DatabaseException("File does not exist: " + file); } } } if (files.length == 0) { throw new IllegalArgumentException("No files provided"); } if (files.length == 1) { return new FilePageArray(pageSize, files[0], factory, options); } PageArray[] arrays = new PageArray[files.length]; for (int i=0; i<files.length; i++) { arrays[i] = new FilePageArray(pageSize, files[i], factory, options); } return new StripedPageArray(arrays); }
private static PageArray openPageArray(int pageSize, File[] files, FileFactory factory, EnumSet<OpenOption> options) throws IOException { checkPageSize(pageSize); if (!options.contains(OpenOption.CREATE)) { for (File file : files) { if (!file.exists()) { throw new DatabaseException("File does not exist: " + file); } } } if (files.length == 0) { throw new IllegalArgumentException("No files provided"); } if (files.length == 1) { return new FilePageArray(pageSize, files[0], factory, options); } PageArray[] arrays = new PageArray[files.length]; for (int i=0; i<files.length; i++) { arrays[i] = new FilePageArray(pageSize, files[i], factory, options); } return new StripedPageArray(arrays); }
throws IOException checkPageSize(pageSize);
checkPageSize(pageSize);
checkPageSize(pageSize);
checkPageSize(pageSize);