@Override public String getProductName() { return FileUtils.getFilenameWithoutExtension(inputFile); }
/** * Gets the filename without its extension from the given file path. * * @param file the file whose filename is to be extracted. * @return the filename without its extension. */ public static String getFilenameWithoutExtension(File file) { return getFilenameWithoutExtension(file.getName()); }
private File createDataOutputDir() { return new File(outputDir, FileUtils.getFilenameWithoutExtension( outputFile) + DimapProductConstants.DIMAP_DATA_DIRECTORY_EXTENSION); }
@Override public String getProductType() { final String inputFileName = FileUtils.getFilenameWithoutExtension(inputFile); final int dotIndex = inputFileName.indexOf("."); if (dotIndex > 0) { return inputFileName.substring(0, dotIndex); } else { logger.warning("Unable to retrieve the product type from the file name."); return "unknown"; } }
private static String getQcFileNamePart(File productFile, String qcProductType) { final String fileName = FileUtils.getFilenameWithoutExtension(productFile.getName()); final int startPos = fileName.indexOf('.'); final int endPos = fileName.lastIndexOf('.'); String toAppend = ""; if (startPos > 0 && endPos > startPos) { toAppend = fileName.substring(startPos, endPos); } return qcProductType + toAppend; }
static String extractProductName(File fileLocation) { String name = fileLocation.getName(); if (name.endsWith(".gz") || name.endsWith(".zip")) { final int dotIndex = name.lastIndexOf("."); name = name.substring(0, dotIndex); } return FileUtils.getFilenameWithoutExtension(name); }
/** * @param entryName * * @return the fileName of a ZipEntry */ private static String getZipEntryFileName(final String entryName) { Guardian.assertNotNullOrEmpty("entryName", entryName); if (entryName.contains("/")) { return FileUtils.getFilenameWithoutExtension(entryName.substring(entryName.lastIndexOf("/") + 1)); } return (FileUtils.getFilenameWithoutExtension(entryName)); } }
private void readVectorData(final CoordinateReferenceSystem modelCrs, final boolean onlyGCPs) throws IOException { String dataDirName = FileUtils.getFilenameWithoutExtension( inputFile) + DimapProductConstants.DIMAP_DATA_DIRECTORY_EXTENSION; File dataDir = new File(inputDir, dataDirName); File vectorDataDir = new File(dataDir, "vector_data"); if (vectorDataDir.exists()) { File[] vectorFiles = getVectorDataFiles(vectorDataDir, onlyGCPs); for (File vectorFile : vectorFiles) { addVectorDataToProduct(vectorFile, modelCrs); } } }
private File createDataDir() { final String nameWithoutExtension = FileUtils.getFilenameWithoutExtension(_outputFile); return new File(_outputDir, nameWithoutExtension + ".data"); } }
/** * @param header * * @throws IOException */ public LandsatHeaderStream(final File header) throws IOException { final LandsatImageInputStream inputStream = new LandsatImageInputStream(header); initLandsatHeaderStream(inputStream, FileUtils.getFilenameWithoutExtension(header)); }
private void updateProductName() { if (outputFile != null) { getSourceProduct().setName(FileUtils.getFilenameWithoutExtension(outputFile)); } }
private void ensureNamingConvention() { if (outputFile != null) { getSourceProduct().setName(FileUtils.getFilenameWithoutExtension(outputFile)); } }
private void ensureNamingConvention() { if (outputFile != null) { getSourceProduct().setName(FileUtils.getFilenameWithoutExtension(outputFile)); } } void writeGeoTIFFProduct(ImageOutputStream stream, final Product sourceProduct) throws IOException {
private static String createDefaultFileName(final RasterDataNode raster, String maskName) { String productName = FileUtils.getFilenameWithoutExtension(raster.getProduct().getName()); String rasterName = raster.getName(); return productName + "_" + rasterName + "_" + maskName + "_Mask.txt"; }
private String getProductName(File inputFile, TiffFileInfo tiffFileInfo) { final String productName; if (tiffFileInfo.containsField(BaselineTIFFTagSet.TAG_IMAGE_DESCRIPTION)) { final TIFFField imageDescriptionField = tiffFileInfo.getField(BaselineTIFFTagSet.TAG_IMAGE_DESCRIPTION); productName = imageDescriptionField.getAsString(0); } else if (inputFile != null) { productName = FileUtils.getFilenameWithoutExtension(inputFile); } else { productName = "geotiff"; } return productName; }
private static String createDefaultFileName(ProductMetadataView productMetadataView) { return FileUtils.getFilenameWithoutExtension(productMetadataView.getProduct().getName()) + "_" + productMetadataView.getMetadataElement().getName() + ".txt"; }
@Override public void selectionChanged(SelectionChangeEvent event) { String productName = ""; final Product selectedProduct = (Product) event.getSelection().getSelectedValue(); if (selectedProduct != null) { productName = FileUtils.getFilenameWithoutExtension(selectedProduct.getName()); } final TargetProductSelectorModel targetProductSelectorModel = targetProductSelector.getModel(); targetProductSelectorModel.setProductName(productName + TARGET_PRODUCT_NAME_SUFFIX); } }
@Override public void selectionChanged(SelectionChangeEvent event) { String productName = ""; final Product selectedProduct = (Product) event.getSelection().getSelectedValue(); if (selectedProduct != null) { productName = FileUtils.getFilenameWithoutExtension(selectedProduct.getName()); } final TargetProductSelectorModel targetProductSelectorModel = targetProductSelector.getModel(); targetProductSelectorModel.setProductName(productName + TARGET_PRODUCT_NAME_SUFFIX); } }
void updateForm() { if (form.getSettingsFile() != null) { optionsWindow.setTitle(DIALOG_TITLE + " - " + FileUtils.getFilenameWithoutExtension(form.getSettingsFile())); } else { optionsWindow.setTitle(DIALOG_TITLE); } form.getBindingContext().adjustComponents(); form.updateState(); }
private Product createProduct(File inputFile) { final String name = FileUtils.getFilenameWithoutExtension(inputFile); final String type = "CHRIS_M" + chrisFile.getGlobalAttribute(ChrisConstants.ATTR_NAME_CHRIS_MODE, 0); final Product product = new Product(name, type, sceneRasterWidth, sceneRasterHeight, this); product.setFileLocation(chrisFile.getFile()); setStartAndEndTimes(product); addMetadataElements(product); addRciAndMaskBands(product); addFlagCodingsAndMasks(product); // due to mask refinement the preferred tile size has full size product.setPreferredTileSize(sceneRasterWidth, sceneRasterHeight); return product; }