Tabnine Logo
DataStoreException
Code IndexAdd Tabnine to your IDE (free)

How to use
DataStoreException
in
org.apache.sis.storage

Best Java code snippets using org.apache.sis.storage.DataStoreException (Showing top 20 results out of 315)

origin: apache/sis

/**
 * Loads a subset of the grid coverage represented by this resource.
 *
 * @param  domain  desired grid extent and resolution, or {@code null} for reading the whole domain.
 * @param  range   0-based index of sample dimensions to read, or an empty sequence for reading all ranges.
 * @return the grid coverage for the specified domain and range.
 * @throws DataStoreException if an error occurred while reading the grid coverage data.
 */
@Override
public GridCoverage read(final GridGeometry domain, final int... range) throws DataStoreException {
  throw new DataStoreException("Not yet implemented.");   // TODO
}
origin: apache/sis

/**
 * Returns a stream of all features contained in this dataset.
 *
 * @param  parallel  {@code true} for a parallel stream (if supported), or {@code false} for a sequential stream.
 * @return all features contained in this dataset.
 * @throws DataStoreException if an error occurred while creating the stream.
 */
@Override
public Stream<AbstractFeature> features(final boolean parallel) throws DataStoreException {
  DataStoreException ex;
  Connection connection = null;
  try {
    connection = source.getConnection();
    final Features iter = features(connection, new ArrayList<>(), null);
    return StreamSupport.stream(iter, parallel).onClose(iter);
  } catch (SQLException cause) {
    ex = new DataStoreException(Exceptions.unwrap(cause));
  }
  if (connection != null) try {
    connection.close();
  } catch (SQLException e) {
    ex.addSuppressed(e);
  }
  throw ex;
}
origin: apache/sis

  /**
   * Closes this data store and releases any underlying resources.
   *
   * @throws DataStoreException if an error occurred while closing this data store.
   */
  @Override
  public synchronized void close() throws DataStoreException {
    final Reader r = reader;
    reader = null;
    if (r != null) try {
      r.close();
    } catch (Exception e) {
      final DataStoreException ds = new DataStoreException(e);
      try {
        super.close();
      } catch (DataStoreException s) {
        ds.addSuppressed(s.getCause());
      }
      throw ds;
    }
    super.close();
  }
}
origin: apache/sis

  throw new DataStoreContentException(getLocale(), "WKT", getDisplayName(), in).initCause(e);
} catch (IOException e) {
  throw new DataStoreException(getLocale(), "WKT", getDisplayName(), in).initCause(e);
origin: org.apache.sis.storage/sis-storage

  /**
   * Closes all children resources.
   */
  @Override
  public synchronized void close() throws DataStoreException {
    final Collection<Resource> resources = components;
    if (resources != null) {
      components = null;                                      // Clear first in case of failure.
      DataStoreException failure = null;
      for (final Resource r : resources) {
        if (r instanceof DataStore) try {
          ((DataStore) r).close();
        } catch (DataStoreException ex) {
          if (failure == null) {
            failure = ex;
          } else {
            failure.addSuppressed(ex);
          }
        }
      }
      if (failure != null) {
        throw failure;
      }
    }
  }
}
origin: org.apache.sis.storage/sis-storage

  /**
   * Probes the given file by delegating to {@link DataStores#probeContentType(Object)}.
   *
   * @param  path  the path to the file to probe.
   * @return the content type or {@code null} if the file type is not recognized.
   * @throws IOException if an I/O error occurs while reading the file.
   *
   * @see java.nio.file.Files#probeContentType(Path)
   */
  @Override
  public String probeContentType(final Path path) throws IOException {
    try {
      return DataStores.probeContentType(path);
    } catch (DataStoreException e) {
      final Throwable cause = e.getCause();
      if (cause instanceof IOException) {
        throw (IOException) cause;
      }
      throw new IOException(e);
    }
  }
}
origin: org.apache.sis.storage/sis-netcdf

throw malformedHeader().initCause(cause);
origin: org.apache.sis.storage/sis-storage

  throw new DataStoreContentException(getLocale(), "WKT", getDisplayName(), in).initCause(e);
} catch (IOException e) {
  throw new DataStoreException(getLocale(), "WKT", getDisplayName(), in).initCause(e);
origin: apache/sis

  /**
   * Closes all children resources.
   */
  @Override
  public synchronized void close() throws DataStoreException {
    final Collection<Resource> resources = components;
    if (resources != null) {
      components = null;                                      // Clear first in case of failure.
      DataStoreException failure = null;
      for (final Resource r : resources) {
        if (r instanceof DataStore) try {
          ((DataStore) r).close();
        } catch (DataStoreException ex) {
          if (failure == null) {
            failure = ex;
          } else {
            failure.addSuppressed(ex);
          }
        }
      }
      if (failure != null) {
        throw failure;
      }
    }
  }
}
origin: apache/sis

  /**
   * Probes the given file by delegating to {@link DataStores#probeContentType(Object)}.
   *
   * @param  path  the path to the file to probe.
   * @return the content type or {@code null} if the file type is not recognized.
   * @throws IOException if an I/O error occurs while reading the file.
   *
   * @see java.nio.file.Files#probeContentType(Path)
   */
  @Override
  public String probeContentType(final Path path) throws IOException {
    try {
      return DataStores.probeContentType(path);
    } catch (DataStoreException e) {
      final Throwable cause = e.getCause();
      if (cause instanceof IOException) {
        throw (IOException) cause;
      }
      throw new IOException(e);
    }
  }
}
origin: Geomatys/geotoolkit

/**
 * Create a new storage location.
 * This method is intended to create from scratch a new storage location.
 * <br/>
 * If the purpose is to open an already existing  storage use the open method :
 * @see DataStoreFactory#open(org.opengis.parameter.ParameterValueGroup)
 *
 * @param params
 * @return FeatureStore created store
 * @throws DataStoreException if parameters are incorrect or creation failed.
 */
public DataStore create(ParameterValueGroup params) throws DataStoreException {
  throw new DataStoreException("Store creation not supported");
}
origin: org.apache.sis.storage/sis-storage

  throw e;
} catch (Exception e) {
  throw new DataStoreException(e);
} catch (Exception e) {
  if (failure == null) {
    failure = (e instanceof DataStoreException) ? (DataStoreException) e : new DataStoreException(e);
  } else {
    failure.addSuppressed(e);
origin: org.apache.sis.storage/sis-storage

  throw new DataStoreException(getLocale(), StoreProvider.NAME, super.getDisplayName(), source).initCause(e);
} catch (FactoryException e) {
  throw new DataStoreReferencingException(getLocale(), StoreProvider.NAME, super.getDisplayName(), source).initCause(e);
origin: org.apache.sis.storage/sis-netcdf

  keepOpen = path;
} catch (IOException | DataStoreException s) {
  e.addSuppressed(s);
origin: org.apache.sis.storage/sis-storage

  /**
   * Closes this data store and releases any underlying resources.
   *
   * @throws DataStoreException if an error occurred while closing this data store.
   */
  @Override
  public synchronized void close() throws DataStoreException {
    final BufferedReader s = source;
    source = null;                  // Cleared first in case of failure.
    if (s != null) try {
      s.close();
    } catch (IOException e) {
      throw new DataStoreException(e);
    }
  }
}
origin: apache/sis

  throw e;
} catch (Exception e) {
  throw new DataStoreException(e);
} catch (Exception e) {
  if (failure == null) {
    failure = (e instanceof DataStoreException) ? (DataStoreException) e : new DataStoreException(e);
  } else {
    failure.addSuppressed(e);
origin: apache/sis

  throw new DataStoreException(getLocale(), StoreProvider.NAME, super.getDisplayName(), source).initCause(e);
} catch (FactoryException e) {
  throw new DataStoreReferencingException(getLocale(), StoreProvider.NAME, super.getDisplayName(), source).initCause(e);
origin: Geomatys/geotoolkit

@Override
public <T> T load(Class<T> expectedType) throws DataStoreException {
  if (expectedType != null && !expectedType.isInstance(instance)) {
    throw new DataStoreException("Data object can not be mapped to type "+expectedType);
  }
  return expectedType.cast(instance);
}
origin: org.apache.sis.storage/sis-storage

          connector.closeAllExcept(null);
        } catch (DataStoreException s) {
          ex.addSuppressed(s);
} catch (DirectoryIteratorException | UncheckedIOException ex) {
  throw new DataStoreException(canNotRead(), ex.getCause());
} catch (IOException ex) {
  throw new DataStoreException(canNotRead(), ex);
} catch (BackingStoreException ex) {
  throw ex.unwrapOrRethrow(DataStoreException.class);
origin: apache/sis

  /**
   * Closes this data store and releases any underlying resources.
   *
   * @throws DataStoreException if an error occurred while closing this data store.
   */
  @Override
  public synchronized void close() throws DataStoreException {
    final BufferedReader s = source;
    source = null;                  // Cleared first in case of failure.
    if (s != null) try {
      s.close();
    } catch (IOException e) {
      throw new DataStoreException(e);
    }
  }
}
org.apache.sis.storageDataStoreException

Javadoc

Thrown when a DataStore can not complete a read or write operation.
Localization
The #getMessage() and #getLocalizedMessage() methods return the same message, but sometime in different languages. The general policy is that #getMessage() returns the message in the JVM Locale#getDefault() while #getLocalizedMessage()returns the message in the locale specified by the last call to DataStore#setLocale(Locale). In a client-server architecture, the former is typically the locale of the system administrator while the later is presumably the locale of the client connected to the server. However this policy is applied on a best-effort basis only.

Most used methods

  • <init>
    Workaround for RFE #4093999 ("Relax constraint on placement of this()/super() call in constructors")
  • addSuppressed
  • getCause
  • initCause
    Initializes the cause of this throwable to the specified value.

Popular in Java

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSupportFragmentManager (FragmentActivity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now