You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2016/08/29 14:42:18 UTC
svn commit: r1758237 - in /sis/branches/JDK8/storage:
sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/
sis-storage/src/main/java/org/apache/sis/internal/storage/xml/
sis-storage/src/main/java/org/apache/sis/storage/
Author: desruisseaux
Date: Mon Aug 29 14:42:17 2016
New Revision: 1758237
URL: http://svn.apache.org/viewvc?rev=1758237&view=rev
Log:
Javadoc fixes and rename 'storage' parameter name as 'connector' for consistency.
There is no significant code change in this commit.
Modified:
sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/MimeTypeDetector.java
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java
Modified: sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java?rev=1758237&r1=1758236&r2=1758237&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java [UTF-8] Mon Aug 29 14:42:17 2016
@@ -58,19 +58,19 @@ public class NetcdfStore extends DataSto
* This constructor invokes {@link StorageConnector#closeAllExcept(Object)}, keeping open only the
* needed resource.
*
- * @param storage Information about the storage (URL, stream, {@link ucar.nc2.NetcdfFile} instance, <i>etc</i>).
+ * @param connector information about the storage (URL, stream, {@link ucar.nc2.NetcdfFile} instance, <i>etc</i>).
* @throws DataStoreException if an error occurred while opening the NetCDF file.
*/
- public NetcdfStore(final StorageConnector storage) throws DataStoreException {
- ArgumentChecks.ensureNonNull("storage", storage);
+ public NetcdfStore(final StorageConnector connector) throws DataStoreException {
+ ArgumentChecks.ensureNonNull("connector", connector);
try {
- decoder = NetcdfStoreProvider.decoder(listeners, storage);
+ decoder = NetcdfStoreProvider.decoder(listeners, connector);
} catch (IOException e) {
throw new DataStoreException(e);
}
if (decoder == null) {
throw new DataStoreContentException(Errors.format(Errors.Keys.IllegalInputTypeForReader_2,
- "NetCDF", Classes.getClass(storage.getStorage())));
+ "NetCDF", Classes.getClass(connector.getStorage())));
}
}
@@ -79,7 +79,7 @@ public class NetcdfStore extends DataSto
* such as the spatiotemporal extent of the dataset, contact information about the creator or distributor,
* data quality, usage constraints and more.
*
- * @return Information about the dataset.
+ * @return information about the dataset.
* @throws DataStoreException if an error occurred while reading the data.
*/
@Override
@@ -115,7 +115,7 @@ public class NetcdfStore extends DataSto
* Returns a string representation of this NetCDF store for debugging purpose.
* The content of the string returned by this method may change in any future SIS version.
*
- * @return A string representation of this datastore for debugging purpose.
+ * @return a string representation of this datastore for debugging purpose.
*/
@Debug
@Override
Modified: sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java?rev=1758237&r1=1758236&r2=1758237&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java [UTF-8] Mon Aug 29 14:42:17 2016
@@ -120,16 +120,16 @@ public class NetcdfStoreProvider extends
* only that there appears to be a reasonable chance of success based on a brief inspection of the
* {@linkplain StorageConnector#getStorage() storage object} or contents.
*
- * @param storage information about the storage (URL, stream, {@link ucar.nc2.NetcdfFile} instance, <i>etc</i>).
+ * @param connector information about the storage (URL, stream, {@link ucar.nc2.NetcdfFile} instance, <i>etc</i>).
* @return {@code SUPPORTED} if the given storage seems to be usable by the {@code NetcdfStore} instances.
* @throws DataStoreException if an I/O error occurred.
*/
@Override
- public ProbeResult probeContent(StorageConnector storage) throws DataStoreException {
+ public ProbeResult probeContent(StorageConnector connector) throws DataStoreException {
int version = 0;
boolean hasVersion = false;
boolean isSupported = false;
- final ByteBuffer buffer = storage.getStorageAs(ByteBuffer.class);
+ final ByteBuffer buffer = connector.getStorageAs(ByteBuffer.class);
if (buffer != null) {
if (buffer.remaining() < Integer.BYTES) {
return ProbeResult.INSUFFICIENT_BYTES;
@@ -151,7 +151,7 @@ public class NetcdfStoreProvider extends
* has special cases for "file:", "http:", "nodods:" and "slurp:" protocols.
*/
if (!isSupported) {
- final String path = storage.getStorageAs(String.class);
+ final String path = connector.getStorageAs(String.class);
if (path != null) {
ensureInitialized();
final Method method = canOpenFromPath;
@@ -182,7 +182,7 @@ public class NetcdfStoreProvider extends
* We check classnames instead of netcdfFileClass.isInstance(storage)
* in order to avoid loading the UCAR library if not needed.
*/
- for (Class<?> type = storage.getStorage().getClass(); type != null; type = type.getSuperclass()) {
+ for (Class<?> type = connector.getStorage().getClass(); type != null; type = type.getSuperclass()) {
if (UCAR_CLASSNAME.equals(type.getName())) {
isSupported = true;
break;
@@ -203,13 +203,13 @@ public class NetcdfStoreProvider extends
/**
* Returns a {@link NetcdfStore} implementation associated with this provider.
*
- * @param storage information about the storage (URL, stream, {@link ucar.nc2.NetcdfFile} instance, <i>etc</i>).
+ * @param connector information about the storage (URL, stream, {@link ucar.nc2.NetcdfFile} instance, <i>etc</i>).
* @return a data store implementation associated with this provider for the given storage.
* @throws DataStoreException if an error occurred while creating the data store instance.
*/
@Override
- public DataStore open(final StorageConnector storage) throws DataStoreException {
- return new NetcdfStore(storage);
+ public DataStore open(final StorageConnector connector) throws DataStoreException {
+ return new NetcdfStore(connector);
}
/**
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/MimeTypeDetector.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/MimeTypeDetector.java?rev=1758237&r1=1758236&r2=1758237&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/MimeTypeDetector.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/MimeTypeDetector.java [UTF-8] Mon Aug 29 14:42:17 2016
@@ -105,7 +105,7 @@ abstract class MimeTypeDetector {
* to read. We are typically not allowed to read the full stream because only a limited amount of bytes is
* cached.
*
- * @return The character, or -1 on EOF.
+ * @return the character, or -1 on EOF.
* @throws IOException if an error occurred while reading the byte or character.
*/
abstract int read() throws IOException;
@@ -114,8 +114,8 @@ abstract class MimeTypeDetector {
* Skips all bytes or characters up to {@code search}, then returns the character after it.
* Characters inside quotes will be ignored.
*
- * @param search The byte or character to skip.
- * @return The byte or character after {@code search}, or -1 on EOF.
+ * @param search the byte or character to skip.
+ * @return the byte or character after {@code search}, or -1 on EOF.
* @throws IOException if an error occurred while reading the bytes or characters.
*/
private int readAfter(final int search) throws IOException {
@@ -139,7 +139,7 @@ abstract class MimeTypeDetector {
* and all control characters (character below 32, which include tabulations and line feeds).
* This is the same criterion than {@link String#trim()}, but is not Unicode spaces.</p>
*
- * @return The first non-space character, or -1 on EOF.
+ * @return the first non-space character, or -1 on EOF.
* @throws IOException if an error occurred while reading the bytes or characters.
*/
private int afterSpaces(int c) throws IOException {
@@ -154,9 +154,9 @@ abstract class MimeTypeDetector {
* After this method class, the stream position is on the first character after the separator if
* a match has been found, or after the first unknown character otherwise.
*
- * @param word The word to search, as US-ASCII characters.
- * @param n Number of valid characters in {@code word}.
- * @param separator The {@code ':'} or {@code '='} character.
+ * @param word the word to search, as US-ASCII characters.
+ * @param n number of valid characters in {@code word}.
+ * @param separator the {@code ':'} or {@code '='} character.
* @return 1 if a match is found, 0 if no match, or -1 on EOF.
* @throws IOException if an error occurred while reading the bytes or characters.
*/
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java?rev=1758237&r1=1758236&r2=1758237&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java [UTF-8] Mon Aug 29 14:42:17 2016
@@ -80,7 +80,7 @@ final class Store extends DataStore {
/**
* Creates a new XML store from the given file, URL or stream.
*
- * @param connector Information about the storage (URL, stream, <i>etc</i>).
+ * @param connector information about the storage (URL, stream, <i>etc</i>).
* @throws DataStoreException if an error occurred while opening the stream.
*/
public Store(final StorageConnector connector) throws DataStoreException {
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java?rev=1758237&r1=1758236&r2=1758237&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java [UTF-8] Mon Aug 29 14:42:17 2016
@@ -68,11 +68,11 @@ public class StoreProvider extends DataS
* @throws DataStoreException if an I/O or SQL error occurred.
*/
@Override
- public ProbeResult probeContent(final StorageConnector storage) throws DataStoreException {
+ public ProbeResult probeContent(final StorageConnector connector) throws DataStoreException {
/*
* Usual case. This include InputStream, DataInput, File, Path, URL, URI.
*/
- final ByteBuffer buffer = storage.getStorageAs(ByteBuffer.class);
+ final ByteBuffer buffer = connector.getStorageAs(ByteBuffer.class);
if (buffer != null) {
if (buffer.remaining() < HEADER.length) {
return ProbeResult.INSUFFICIENT_BYTES;
@@ -101,7 +101,7 @@ public class StoreProvider extends DataS
* We should enter in this block only if the user gave us explicitely a Reader.
* A common case is a StringReader wrapping a String object.
*/
- final Reader reader = storage.getStorageAs(Reader.class);
+ final Reader reader = connector.getStorageAs(Reader.class);
if (reader != null) try {
// Quick check for "<?xml " header.
reader.mark(HEADER.length + READ_AHEAD_LIMIT);
@@ -129,12 +129,12 @@ public class StoreProvider extends DataS
/**
* Returns a {@link Store} implementation associated with this provider.
*
- * @param storage Information about the storage (URL, stream, <i>etc</i>).
- * @return A data store implementation associated with this provider for the given storage.
- * @throws DataStoreException If an error occurred while creating the data store instance.
+ * @param connector information about the storage (URL, stream, <i>etc</i>).
+ * @return a data store implementation associated with this provider for the given storage.
+ * @throws DataStoreException if an error occurred while creating the data store instance.
*/
@Override
- public DataStore open(final StorageConnector storage) throws DataStoreException {
- return new Store(storage);
+ public DataStore open(final StorageConnector connector) throws DataStoreException {
+ return new Store(connector);
}
}
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java?rev=1758237&r1=1758236&r2=1758237&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java [UTF-8] Mon Aug 29 14:42:17 2016
@@ -104,13 +104,13 @@ public abstract class DataStoreProvider
* }
* </div>
*
- * @param storage Information about the storage (URL, stream, JDBC connection, <i>etc</i>).
+ * @param connector information about the storage (URL, stream, JDBC connection, <i>etc</i>).
* @return {@link ProbeResult#SUPPORTED} if the given storage seems to be readable by the {@code DataStore}
* instances created by this provider.
* @throws DataStoreException if an I/O or SQL error occurred. The error shall be unrelated to the logical
* structure of the storage.
*/
- public abstract ProbeResult probeContent(StorageConnector storage) throws DataStoreException;
+ public abstract ProbeResult probeContent(StorageConnector connector) throws DataStoreException;
/**
* Returns a data store implementation associated with this provider.
@@ -119,9 +119,9 @@ public abstract class DataStoreProvider
* Implementors shall invoke {@link StorageConnector#closeAllExcept(Object)} after {@code DataStore}
* creation, keeping open only the needed resource.
*
- * @param storage Information about the storage (URL, stream, JDBC connection, <i>etc</i>).
- * @return A data store implementation associated with this provider for the given storage.
- * @throws DataStoreException If an error occurred while creating the data store instance.
+ * @param storage information about the storage (URL, stream, JDBC connection, <i>etc</i>).
+ * @return a data store implementation associated with this provider for the given storage.
+ * @throws DataStoreException if an error occurred while creating the data store instance.
*
* @see DataStores#open(Object)
*/