use of org.apache.sis.metadata.iso.distribution.DefaultFormat in project sis by apache.
the class Store method getFormat.
/**
* Returns a more complete description of the GPX format.
* The format will be part of the metadata returned by {@link #getMetadata()}.
*
* @see StoreProvider#getFormat()
* @see org.apache.sis.internal.storage.gpx.Metadata#getResourceFormats()
*/
final Format getFormat() {
assert Thread.holdsLock(this);
Format format = ((StoreProvider) provider).getFormat(listeners);
if (version != null) {
final DefaultFormat df = new DefaultFormat(format);
final DefaultCitation citation = new DefaultCitation(df.getFormatSpecificationCitation());
citation.setEdition(new SimpleInternationalString(version.toString()));
df.setFormatSpecificationCitation(citation);
format = df;
}
return format;
}
use of org.apache.sis.metadata.iso.distribution.DefaultFormat in project sis by apache.
the class MetadataSourceTest method testSearch.
/**
* Tests {@link MetadataSource#search(Object)}
*
* @param source the instance to test.
* @throws MetadataStoreException if an error occurred while querying the database.
*/
@TestStep
public static void testSearch(final MetadataSource source) throws MetadataStoreException {
final DefaultCitation specification = new DefaultCitation("PNG (Portable Network Graphics) Specification");
specification.setAlternateTitles(Collections.singleton(new SimpleInternationalString("PNG")));
final DefaultFormat format = new DefaultFormat();
format.setFormatSpecificationCitation(specification);
assertEquals("PNG", source.search(format));
specification.setTitle(null);
assertNull(source.search(format));
}
use of org.apache.sis.metadata.iso.distribution.DefaultFormat in project sis by apache.
the class MetadataBuilder method addCompression.
/**
* Adds a compression name.
* Storage location is:
*
* <ul>
* <li>{@code metadata/identificationInfo/resourceFormat/fileDecompressionTechnique}</li>
* </ul>
*
* @param value the compression name, or {@code null} for no-operation.
*
* @see #setFormat(String)
*/
public final void addCompression(final CharSequence value) {
final InternationalString i18n = trim(value);
if (i18n != null) {
final DefaultFormat format = format();
format.setFileDecompressionTechnique(append(format.getFileDecompressionTechnique(), i18n));
}
}
Aggregations