@Override public String getName() { return delegateFormat.getName(); }
public static Format acquireFormat(String type) throws IOException { Format[] formats = GridFormatFinder.getFormatArray(); Format format = null; final int length = formats.length; for (int i = 0; i < length; i++) { if (formats[i].getName().equals(type)) { format = formats[i]; break; } } if (format == null) { throw new IOException("Cannot handle format: " + type); } else { return format; } }
/** * When loading from DTO use the params to locate factory. * * <p>bleck */ public static Format aquireFactoryByType(String type) { final Format[] formats = GridFormatFinder.getFormatArray(); Format format = null; final int length = formats.length; for (int i = 0; i < length; i++) { format = formats[i]; if (format.getName().equals(type)) { return format; } } return null; }
/** * Returns the format for a coverage. * * <p>The format is inferred from {@link CoverageStoreInfo#getType()} * * @param info The coverage metadata. * @return The format, or null. */ @SuppressWarnings("deprecation") public AbstractGridFormat getGridCoverageFormat(CoverageStoreInfo info) { final int length = CoverageStoreUtils.formats.length; for (int i = 0; i < length; i++) { if (CoverageStoreUtils.formats[i].getName().equals(info.getType())) { return (AbstractGridFormat) CoverageStoreUtils.formats[i]; } } return null; }
throw new Exception( "Unable to acquire test coverage and image layout for format:" + format.getName()); throw new Exception( "Unable to acquire test coverage and color model for format:" + format.getName()); throw new Exception( "Unable to acquire test coverage and sample model for format:" + format.getName());
new StringBuilder("Generated from ").append(format.getName()).toString()); cinfo.getKeywords().add(new Keyword(format.getName())); cinfo.setNativeFormat(format.getName()); cinfo.getMetadata() .put( for (Iterator i = formats.iterator(); i.hasNext(); ) { final Format fTmp = (Format) i.next(); final String fName = fTmp.getName();
/** @return the name/description set of available raster formats */ private Map<String, Format> getAvailableCoverageStores() { if (coverages == null) { Format[] availableFormats = GridFormatFinder.getFormatArray(); Map<String, Format> formatNames = new HashMap<String, Format>(); for (Format format : availableFormats) { formatNames.put(format.getName(), format); } coverages = formatNames; } return coverages; }
/** * @return the name/description set of available raster formats */ private Map<String, Format> getAvailableCoverageStores() { if (coverages == null) { Format[] availableFormats = GridFormatFinder.getFormatArray(); Map<String, Format> formatNames = new HashMap<String, Format>(); for (Format format : availableFormats) { formatNames.put(format.getName(), format); } coverages = formatNames; } return coverages; }
@Override public String getMimeType(CoverageInfo ci) throws IOException { GridCoverageReader reader = ci.getGridCoverageReader(null, null); if (formatName.equals(reader.getFormat().getName())) { return mime; } return null; } }
public Object getPropertyValue(StoreInfo item) { String type = item.getType(); if(type != null) { return type; } try { ResourcePool resourcePool = getCatalog().getResourcePool(); if(item instanceof DataStoreInfo) { DataStoreInfo dsInfo = (DataStoreInfo) item; DataAccessFactory factory = resourcePool.getDataStoreFactory(dsInfo); if(factory != null) { return factory.getDisplayName(); } } else if(item instanceof CoverageStoreInfo) { Format format = resourcePool.getGridCoverageFormat((CoverageStoreInfo) item); if(format != null) { return format.getName(); } } } catch(Exception e) { // fine, we tried } return "?"; } };
public Object getPropertyValue(StoreInfo item) { String type = item.getType(); if (type != null) { return type; } try { ResourcePool resourcePool = getCatalog().getResourcePool(); if (item instanceof DataStoreInfo) { DataStoreInfo dsInfo = (DataStoreInfo) item; DataAccessFactory factory = resourcePool.getDataStoreFactory(dsInfo); if (factory != null) { return factory.getDisplayName(); } } else if (item instanceof CoverageStoreInfo) { Format format = resourcePool.getGridCoverageFormat((CoverageStoreInfo) item); if (format != null) { return format.getName(); } } } catch (Exception e) { // fine, we tried } return "?"; } };
info.setType(coverageFormat.getName()); URL uploadedFileURL = URLs.fileToUrl(Resources.find(uploadedFile)); if (method.isInline()) {
info.setType(coverageFormat.getName()); if (isInlineUpload(method)) {