public File getFileInput(Object input) { return super.getFileInput(input); }
public File getFileInput(Object input) { return super.getFileInput(input); }
/** * Returns an abstraction of the given input. * If the input is a (not compressed or packed) file, it returns a <code>com.bc.ceres.core.VirtualDir.File</code> object. * If the input is a folder, it returns a <code>com.bc.ceres.core.VirtualDir.Dir</code> object. * If the input is either a tar file or a tgz file, it returns a <code>org.sa.beam.dataio.VirtualDirEx.TarVirtualDir</code> object. * If the input is a compressed file, it returns a wrapper over a <code>com.bc.ceres.core.VirtualDir.Zip</code> object. * @param input The input object * @return An instance of a VirtualDir or VirtualDirEx implementations. * @throws IOException If unable to retrieve the parent of the input. */ public VirtualDirEx getInput(Object input) throws IOException { File inputFile = getFileInput(input); if (inputFile.isFile() && !VirtualDirEx.isPackedFile(inputFile)) { final File absoluteFile = inputFile.getAbsoluteFile(); inputFile = absoluteFile.getParentFile(); if (inputFile == null) { throw new IOException("Unable to retrieve parent to file: " + absoluteFile.getAbsolutePath()); } } return VirtualDirEx.create(inputFile); }
File inputFile = getFileInput(input); if (inputFile.isFile() && Arrays.stream(patternList).anyMatch(p -> p.matcher(inputFile.getName()).matches())) {