| <!DOCTYPE HTML> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (19) --> |
| <title>StorageConnector (Apache SIS 1.3 API)</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="description" content="declaration: package: org.apache.sis.storage, class: StorageConnector"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <meta name="keywords" content="org.apache.sis.storage.StorageConnector class"> |
| <meta name="keywords" content="getOption()"> |
| <meta name="keywords" content="setOption()"> |
| <meta name="keywords" content="getStorage()"> |
| <meta name="keywords" content="getStorageName()"> |
| <meta name="keywords" content="getFileExtension()"> |
| <meta name="keywords" content="getStorageAs()"> |
| <meta name="keywords" content="commit()"> |
| <meta name="keywords" content="closeAllExcept()"> |
| <meta name="keywords" content="toString()"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../sis.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.min.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../script-dir/jquery-3.6.0.min.js"></script> |
| <script type="text/javascript" src="../../../../script-dir/jquery-ui.min.js"></script> |
| </head> |
| <body class="class-declaration-page"> |
| <script type="text/javascript">var pathtoroot = "../../../../"; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <div class="flex-box"> |
| <header role="banner" class="flex-header"> |
| <nav role="navigation"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button> |
| <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div> |
| <ul id="navbar-top-firstrow" class="nav-list" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="nav-bar-cell1-rev">Class</li> |
| <li><a href="class-use/StorageConnector.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html#class">Help</a></li> |
| </ul> |
| <ul class="sub-nav-list-small"> |
| <li> |
| <p>Summary:</p> |
| <ul> |
| <li>Nested</li> |
| <li>Field</li> |
| <li><a href="#constructor-summary">Constr</a></li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| </li> |
| <li> |
| <p>Detail:</p> |
| <ul> |
| <li>Field</li> |
| <li><a href="#constructor-detail">Constr</a></li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="sub-nav"> |
| <div id="navbar-sub-list"> |
| <ul class="sub-nav-list"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor-summary">Constr</a> | </li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| <ul class="sub-nav-list"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor-detail">Constr</a> | </li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </div> |
| <div class="nav-list-search"><a href="../../../../search.html">SEARCH</a> |
| <input type="text" id="search-input" disabled placeholder="Search"> |
| <input type="reset" id="reset-button" disabled value="reset"> |
| </div> |
| </div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <span class="skip-nav" id="skip-navbar-top"></span></nav> |
| </header> |
| <div class="flex-content"> |
| <main role="main"> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">org.apache.sis.storage</a></div> |
| <h1 title="Class StorageConnector" class="title">Class StorageConnector</h1> |
| </div> |
| <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> |
| <div class="inheritance">StorageConnector</div> |
| </div> |
| <section class="class-description" id="class-description"> |
| <dl class="notes"> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></code></dd> |
| </dl> |
| <hr> |
| <div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">StorageConnector</span> |
| <span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> |
| implements <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></span></div> |
| <div class="block">Information for creating a connection to a <a href="DataStore.html" title="class in org.apache.sis.storage"><code>DataStore</code></a> in read and/or write mode. |
| <code>StorageConnector</code> wraps an input <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link"><code>Object</code></a>, which can be any of the following types: |
| |
| <ul> |
| <li>A <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/Path.html" title="class or interface in java.nio.file" class="external-link"><code>Path</code></a> or a <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/File.html" title="class or interface in java.io" class="external-link"><code>File</code></a> for a file or a directory.</li> |
| <li>A <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URI.html" title="class or interface in java.net" class="external-link"><code>URI</code></a> or a <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URL.html" title="class or interface in java.net" class="external-link"><code>URL</code></a> to a distant resource.</li> |
| <li>A <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link"><code>CharSequence</code></a> interpreted as a filename or a URL.</li> |
| <li>A <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/channels/Channel.html" title="class or interface in java.nio.channels" class="external-link"><code>Channel</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/DataInput.html" title="class or interface in java.io" class="external-link"><code>DataInput</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/InputStream.html" title="class or interface in java.io" class="external-link"><code>InputStream</code></a> or <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/Reader.html" title="class or interface in java.io" class="external-link"><code>Reader</code></a>.</li> |
| <li>A <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.sql/javax/sql/DataSource.html" title="class or interface in javax.sql" class="external-link"><code>DataSource</code></a> or a <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.sql/java/sql/Connection.html" title="class or interface in java.sql" class="external-link"><code>Connection</code></a> to a JDBC database.</li> |
| <li>Any other <code>DataStore</code>-specific object, for example <code>NetcdfFile</code>.</li> |
| </ul> |
| |
| The <a href="#getStorageAs(java.lang.Class)"><code>getStorageAs(Class)</code></a> method provides the storage as an object of the given type, opening |
| the input stream if necessary. This class tries to open the stream only once - subsequent invocation |
| of <code>getStorageAs(…)</code> may return the same input stream. |
| |
| <p>This class is used only for discovery of a <code>DataStore</code> implementation capable to handle the input. |
| Once a suitable <code>DataStore</code> has been found, the <code>StorageConnector</code> instance is typically |
| discarded since each data store implementation will use their own input/output objects.</p> |
| |
| <h2>Limitations</h2> |
| This class is not thread-safe. |
| Not only <code>StorageConnector</code> should be used by a single thread, |
| but the objects returned by <a href="#getStorageAs(java.lang.Class)"><code>getStorageAs(Class)</code></a> should also be used by the same thread. |
| |
| <p>Instances of this class are serializable if the <code>storage</code> object given at construction time |
| is serializable.</p></div> |
| <dl class="notes"> |
| <dt>Since:</dt> |
| <dd>0.3</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="../../../../serialized-form.html#org.apache.sis.storage.StorageConnector">Serialized Form</a></li> |
| </ul> |
| </dd> |
| |
| <p><font size="-1">Defined in the <code>sis-storage</code> module</font></p> |
| </dl> |
| </section> |
| <section class="summary"> |
| <ul class="summary-list"> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <li> |
| <section class="constructor-summary" id="constructor-summary"> |
| <h2>Constructor Summary</h2> |
| <div class="caption"><span>Constructors</span></div> |
| <div class="summary-table two-column-summary"> |
| <div class="table-header col-first">Constructor</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(java.lang.Object)" class="member-name-link">StorageConnector</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> storage)</code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Creates a new data store connection wrapping the given input/output object.</div> |
| </div> |
| </div> |
| </section> |
| </li> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <li> |
| <section class="method-summary" id="method-summary"> |
| <h2>Method Summary</h2> |
| <div id="method-summary-table"> |
| <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div> |
| <div id="method-summary-table.tabpanel" role="tabpanel"> |
| <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Method</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#closeAllExcept(java.lang.Object)" class="member-name-link">closeAllExcept</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> view)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Closes all streams and connections created by this <code>StorageConnector</code> except the given view.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><S> S</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#commit(java.lang.Class,java.lang.String)" class="member-name-link">commit</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><S> type, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> format)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the storage as a view of the given type and closes all other views.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getFileExtension()" class="member-name-link">getFileExtension</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the filename extension of the input/output object.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><T> T</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getOption(org.apache.sis.setup.OptionKey)" class="member-name-link">getOption</a><wbr>(<a href="../setup/OptionKey.html" title="class in org.apache.sis.setup">OptionKey</a><T> key)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the option value for the given key, or <code>null</code> if none.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getStorage()" class="member-name-link">getStorage</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the input/output object given at construction time.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><S> S</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getStorageAs(java.lang.Class)" class="member-name-link">getStorageAs</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><S> type)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the storage as a view of the given type if possible, or <code>null</code> otherwise.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getStorageName()" class="member-name-link">getStorageName</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns a short name of the input/output object.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><T> void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setOption(org.apache.sis.setup.OptionKey,T)" class="member-name-link">setOption</a><wbr>(<a href="../setup/OptionKey.html" title="class in org.apache.sis.setup">OptionKey</a><T> key, |
| T value)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Sets the option value for the given key.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toString()" class="member-name-link">toString</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns a string representation of this <code>StorageConnector</code> for debugging purpose.</div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-Object">Methods inherited from class <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3> |
| <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <section class="details"> |
| <ul class="details-list"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <li> |
| <section class="constructor-details" id="constructor-detail"> |
| <h2>Constructor Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="<init>(java.lang.Object)"> |
| <h3>StorageConnector</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="element-name">StorageConnector</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> storage)</span></div> |
| <div class="block">Creates a new data store connection wrapping the given input/output object. |
| The object can be of any type, but the class javadoc lists the most typical ones.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>storage</code> - the input/output object as a URL, file, image input stream, <i>etc.</i>.</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li> |
| <section class="method-details" id="method-detail"> |
| <h2>Method Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="getOption(org.apache.sis.setup.OptionKey)"> |
| <h3>getOption</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="type-parameters"><T></span> <span class="return-type">T</span> <span class="element-name">getOption</span><wbr><span class="parameters">(<a href="../setup/OptionKey.html" title="class in org.apache.sis.setup">OptionKey</a><T> key)</span></div> |
| <div class="block">Returns the option value for the given key, or <code>null</code> if none.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>T</code> - the type of option value.</dd> |
| <dt>Parameters:</dt> |
| <dd><code>key</code> - the option for which to get the value.</dd> |
| <dt>Returns:</dt> |
| <dd>the current value for the given option, or <code>null</code> if none.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setOption(org.apache.sis.setup.OptionKey,T)"> |
| <h3 id="setOption(org.apache.sis.setup.OptionKey,java.lang.Object)">setOption</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="type-parameters"><T></span> <span class="return-type">void</span> <span class="element-name">setOption</span><wbr><span class="parameters">(<a href="../setup/OptionKey.html" title="class in org.apache.sis.setup">OptionKey</a><T> key, |
| T value)</span></div> |
| <div class="block">Sets the option value for the given key. The default implementation recognizes the following options: |
| |
| <ul> |
| <li><a href="../setup/OptionKey.html#ENCODING"><code>OptionKey.ENCODING</code></a> for decoding characters in an input stream, if needed.</li> |
| <li><a href="../setup/OptionKey.html#URL_ENCODING"><code>OptionKey.URL_ENCODING</code></a> for converting URL to URI or filename, if needed.</li> |
| <li><a href="../setup/OptionKey.html#OPEN_OPTIONS"><code>OptionKey.OPEN_OPTIONS</code></a> for specifying whether the data store shall be read only or read/write.</li> |
| <li><a href="../setup/OptionKey.html#BYTE_BUFFER"><code>OptionKey.BYTE_BUFFER</code></a> for allowing users to control the byte buffer to be created.</li> |
| </ul></div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>T</code> - the type of option value.</dd> |
| <dt>Parameters:</dt> |
| <dd><code>key</code> - the option for which to set the value.</dd> |
| <dd><code>value</code> - the new value for the given option, or <code>null</code> for removing the value.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getStorage()"> |
| <h3>getStorage</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span> <span class="element-name">getStorage</span>() |
| throws <span class="exceptions"><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></span></div> |
| <div class="block">Returns the input/output object given at construction time. |
| The object can be of any type, but the class javadoc lists the most typical ones.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the input/output object as a URL, file, image input stream, <i>etc.</i>.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></code> - if the storage object has already been used and cannot be reused.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#getStorageAs(java.lang.Class)"><code>getStorageAs(Class)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getStorageName()"> |
| <h3>getStorageName</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">getStorageName</span>()</div> |
| <div class="block">Returns a short name of the input/output object. For example if the storage is a file, |
| this method returns the filename without the path (but including the file extension). |
| The default implementation performs the following choices based on the type of the |
| <a href="#getStorage()">storage</a> object: |
| |
| <ul> |
| <li>For <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/Path.html" title="class or interface in java.nio.file" class="external-link"><code>Path</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/File.html" title="class or interface in java.io" class="external-link"><code>File</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URI.html" title="class or interface in java.net" class="external-link"><code>URI</code></a> or <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URL.html" title="class or interface in java.net" class="external-link"><code>URL</code></a> |
| instances, this method uses dedicated API like <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/Path.html#getFileName()" title="class or interface in java.nio.file" class="external-link"><code>Path.getFileName()</code></a>.</li> |
| <li>For <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link"><code>CharSequence</code></a> instances, this method gets a string representation of the storage object |
| and returns the part after the last <code>'/'</code> character or platform-dependent name separator.</li> |
| <li>For instances of unknown type, this method builds a string representation using the class name. |
| Note that the string representation of unknown types may change in any future SIS version.</li> |
| </ul></div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>a short name of the storage object.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getFileExtension()"> |
| <h3>getFileExtension</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">getFileExtension</span>()</div> |
| <div class="block">Returns the filename extension of the input/output object. The default implementation performs |
| the following choices based on the type of the <a href="#getStorage()">storage</a> object: |
| |
| <ul> |
| <li>For <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/Path.html" title="class or interface in java.nio.file" class="external-link"><code>Path</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/File.html" title="class or interface in java.io" class="external-link"><code>File</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URI.html" title="class or interface in java.net" class="external-link"><code>URI</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URL.html" title="class or interface in java.net" class="external-link"><code>URL</code></a> or |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link"><code>CharSequence</code></a> instances, this method returns the string after the last <code>'.'</code> character |
| in the filename, provided that the <code>'.'</code> is not the first filename character. This may be an |
| empty string if the filename has no extension, but never <code>null</code>.</li> |
| <li>For instances of unknown type, this method returns <code>null</code>.</li> |
| </ul></div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the filename extension, or an empty string if none, |
| or <code>null</code> if the storage is an object of unknown type.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getStorageAs(java.lang.Class)"> |
| <h3>getStorageAs</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="type-parameters"><S></span> <span class="return-type">S</span> <span class="element-name">getStorageAs</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><S> type)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a>, |
| <a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></span></div> |
| <div class="block">Returns the storage as a view of the given type if possible, or <code>null</code> otherwise. |
| The default implementation accepts the following types: |
| |
| <ul> |
| <li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link"><code>String</code></a>: |
| <ul> |
| <li>If the <a href="#getStorage()">storage</a> object is an instance of the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/Path.html" title="class or interface in java.nio.file" class="external-link"><code>Path</code></a>, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/File.html" title="class or interface in java.io" class="external-link"><code>File</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URL.html" title="class or interface in java.net" class="external-link"><code>URL</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URI.html" title="class or interface in java.net" class="external-link"><code>URI</code></a> or <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link"><code>CharSequence</code></a> types, |
| returns the string representation of their path.</li> |
| |
| <li>Otherwise this method returns <code>null</code>.</li> |
| </ul> |
| </li> |
| <li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/Path.html" title="class or interface in java.nio.file" class="external-link"><code>Path</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URI.html" title="class or interface in java.net" class="external-link"><code>URI</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URL.html" title="class or interface in java.net" class="external-link"><code>URL</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/File.html" title="class or interface in java.io" class="external-link"><code>File</code></a>: |
| <ul> |
| <li>If the <a href="#getStorage()">storage</a> object is an instance of the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/Path.html" title="class or interface in java.nio.file" class="external-link"><code>Path</code></a>, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/File.html" title="class or interface in java.io" class="external-link"><code>File</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URL.html" title="class or interface in java.net" class="external-link"><code>URL</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URI.html" title="class or interface in java.net" class="external-link"><code>URI</code></a> or <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link"><code>CharSequence</code></a> types and |
| that type can be converted to the requested type, returned the conversion result.</li> |
| |
| <li>Otherwise this method returns <code>null</code>.</li> |
| </ul> |
| </li> |
| <li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a>: |
| <ul> |
| <li>If the <a href="#getStorage()">storage</a> object can be obtained as described in bullet 2 of the |
| <code>DataInput</code> section below, then this method returns the associated byte buffer.</li> |
| |
| <li>Otherwise this method returns <code>null</code>.</li> |
| </ul> |
| </li> |
| <li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/DataInput.html" title="class or interface in java.io" class="external-link"><code>DataInput</code></a>: |
| <ul> |
| <li>If the <a href="#getStorage()">storage</a> object is already an instance of <code>DataInput</code> |
| (including the <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/javax/imageio/stream/ImageInputStream.html" title="class or interface in javax.imageio.stream" class="external-link"><code>ImageInputStream</code></a> and <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/javax/imageio/stream/ImageOutputStream.html" title="class or interface in javax.imageio.stream" class="external-link"><code>ImageOutputStream</code></a> types), |
| then it is returned unchanged.</li> |
| |
| <li>Otherwise if the input is an instance of <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a>, then an <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/javax/imageio/stream/ImageInputStream.html" title="class or interface in javax.imageio.stream" class="external-link"><code>ImageInputStream</code></a> |
| backed by a read-only view of that buffer is created when first needed and returned. |
| The properties (position, mark, limit) of the original buffer are unmodified.</li> |
| |
| <li>Otherwise if the input is an instance of <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/Path.html" title="class or interface in java.nio.file" class="external-link"><code>Path</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/File.html" title="class or interface in java.io" class="external-link"><code>File</code></a>, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URI.html" title="class or interface in java.net" class="external-link"><code>URI</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URL.html" title="class or interface in java.net" class="external-link"><code>URL</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link"><code>CharSequence</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/InputStream.html" title="class or interface in java.io" class="external-link"><code>InputStream</code></a> or |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/channels/ReadableByteChannel.html" title="class or interface in java.nio.channels" class="external-link"><code>ReadableByteChannel</code></a>, then an <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/javax/imageio/stream/ImageInputStream.html" title="class or interface in javax.imageio.stream" class="external-link"><code>ImageInputStream</code></a> backed by a |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a> is created when first needed and returned.</li> |
| |
| <li>Otherwise if <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/javax/imageio/ImageIO.html#createImageInputStream(java.lang.Object)" title="class or interface in javax.imageio" class="external-link"><code>ImageIO.createImageInputStream(Object)</code></a> returns a non-null value, |
| then this value is cached and returned.</li> |
| |
| <li>Otherwise this method returns <code>null</code>.</li> |
| </ul> |
| </li> |
| <li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/javax/imageio/stream/ImageInputStream.html" title="class or interface in javax.imageio.stream" class="external-link"><code>ImageInputStream</code></a>: |
| <ul> |
| <li>If the above <code>DataInput</code> can be created and casted to <code>ImageInputStream</code>, returns it.</li> |
| |
| <li>Otherwise this method returns <code>null</code>.</li> |
| </ul> |
| </li> |
| <li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/InputStream.html" title="class or interface in java.io" class="external-link"><code>InputStream</code></a>: |
| <ul> |
| <li>If the <a href="#getStorage()">storage</a> object is already an instance of <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/InputStream.html" title="class or interface in java.io" class="external-link"><code>InputStream</code></a>, |
| then it is returned unchanged.</li> |
| |
| <li>Otherwise if the above <code>ImageInputStream</code> can be created, |
| returns a wrapper around that stream.</li> |
| |
| <li>Otherwise this method returns <code>null</code>.</li> |
| </ul> |
| </li> |
| <li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/Reader.html" title="class or interface in java.io" class="external-link"><code>Reader</code></a>: |
| <ul> |
| <li>If the <a href="#getStorage()">storage</a> object is already an instance of <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/Reader.html" title="class or interface in java.io" class="external-link"><code>Reader</code></a>, |
| then it is returned unchanged.</li> |
| |
| <li>Otherwise if the above <code>InputStream</code> can be created, returns an <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/InputStreamReader.html" title="class or interface in java.io" class="external-link"><code>InputStreamReader</code></a> |
| using the encoding specified by <a href="../setup/OptionKey.html#ENCODING"><code>OptionKey.ENCODING</code></a> if any, or using the system default |
| encoding otherwise.</li> |
| |
| <li>Otherwise this method returns <code>null</code>.</li> |
| </ul> |
| </li> |
| <li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.sql/java/sql/Connection.html" title="class or interface in java.sql" class="external-link"><code>Connection</code></a>: |
| <ul> |
| <li>If the <a href="#getStorage()">storage</a> object is already an instance of <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.sql/java/sql/Connection.html" title="class or interface in java.sql" class="external-link"><code>Connection</code></a>, |
| then it is returned unchanged.</li> |
| |
| <li>Otherwise if the storage is an instance of <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.sql/javax/sql/DataSource.html" title="class or interface in javax.sql" class="external-link"><code>DataSource</code></a>, then a connection is obtained |
| when first needed and returned.</li> |
| |
| <li>Otherwise this method returns <code>null</code>.</li> |
| </ul> |
| </li> |
| <li>Any other types: |
| <ul> |
| <li>If the storage given at construction time is already an instance of the requested type, |
| returns it <i>as-is</i>.</li> |
| |
| <li>Otherwise this method throws <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link"><code>IllegalArgumentException</code></a>.</li> |
| </ul> |
| </li> |
| </ul> |
| |
| <h4>Usage for probing operations</h4> |
| Multiple invocations of this method on the same <code>StorageConnector</code> instance will try |
| to return the same instance on a <cite>best effort</cite> basis. Consequently, implementations of |
| <a href="DataStoreProvider.html#probeContent(org.apache.sis.storage.StorageConnector)"><code>DataStoreProvider.probeContent(StorageConnector)</code></a> methods shall not close the stream or |
| database connection returned by this method. In addition, those <code>probeContent(StorageConnector)</code> |
| methods are responsible for restoring the stream or byte buffer to its original position on return. |
| For an easier and safer way to ensure that the storage position is not modified, |
| see <a href="DataStoreProvider.html#probeContent(org.apache.sis.storage.StorageConnector,java.lang.Class,org.apache.sis.storage.DataStoreProvider.Prober)"><code>DataStoreProvider.probeContent(StorageConnector, Class, Prober)</code></a>.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>S</code> - the compile-time type of the <code>type</code> argument (the source or storage type).</dd> |
| <dt>Parameters:</dt> |
| <dd><code>type</code> - the desired type as one of <code>ByteBuffer</code>, <code>DataInput</code>, <code>Connection</code> |
| class or other types supported by <code>StorageConnector</code> subclasses.</dd> |
| <dt>Returns:</dt> |
| <dd>the storage as a view of the given type, or <code>null</code> if the given type is one of the supported |
| types listed in javadoc but no view can be created for the source given at construction time.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if the given <code>type</code> argument is not one of the supported types |
| listed in this javadoc or in subclass javadoc.</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">IllegalStateException</a></code> - if this <code>StorageConnector</code> has been <a href="#closeAllExcept(java.lang.Object)">closed</a>.</dd> |
| <dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></code> - if an error occurred while opening a stream or database connection.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="#getStorage()"><code>getStorage()</code></a></li> |
| <li><a href="#closeAllExcept(java.lang.Object)"><code>closeAllExcept(Object)</code></a></li> |
| <li><a href="DataStoreProvider.html#probeContent(org.apache.sis.storage.StorageConnector,java.lang.Class,org.apache.sis.storage.DataStoreProvider.Prober)"><code>DataStoreProvider.probeContent(StorageConnector, Class, Prober)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="commit(java.lang.Class,java.lang.String)"> |
| <h3>commit</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="type-parameters"><S></span> <span class="return-type">S</span> <span class="element-name">commit</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><S> type, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> format)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a>, |
| <a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></span></div> |
| <div class="block">Returns the storage as a view of the given type and closes all other views. |
| Invoking this method is equivalent to invoking <a href="#getStorageAs(java.lang.Class)"><code>getStorageAs(Class)</code></a> |
| followed by <a href="#closeAllExcept(java.lang.Object)"><code>closeAllExcept(Object)</code></a> except that the latter method is |
| always invoked (in a way similar to "try with resource") and that this method |
| never returns <code>null</code>.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>S</code> - the compile-time type of the <code>type</code> argument (the source or storage type).</dd> |
| <dt>Parameters:</dt> |
| <dd><code>type</code> - the desired type as one of the types documented in <a href="#getStorageAs(java.lang.Class)"><code>getStorageAs(Class)</code></a> |
| (example: <code>ByteBuffer</code>, <code>DataInput</code>, <code>Connection</code>).</dd> |
| <dd><code>format</code> - short name or abbreviation of the data format (e.g. "CSV", "GML", "WKT", <i>etc</i>). |
| Used for information purpose in error messages if needed.</dd> |
| <dt>Returns:</dt> |
| <dd>the storage as a view of the given type. Never <code>null</code>.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if the given <code>type</code> argument is not one of the supported types.</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">IllegalStateException</a></code> - if this <code>StorageConnector</code> has been <a href="#closeAllExcept(java.lang.Object)">closed</a>.</dd> |
| <dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></code> - if an error occurred while opening a stream or database connection.</dd> |
| <dt>Since:</dt> |
| <dd>1.2</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#getStorageAs(java.lang.Class)"><code>getStorageAs(Class)</code></a></li> |
| <li><a href="#closeAllExcept(java.lang.Object)"><code>closeAllExcept(Object)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="closeAllExcept(java.lang.Object)"> |
| <h3>closeAllExcept</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">closeAllExcept</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> view)</span> |
| throws <span class="exceptions"><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></span></div> |
| <div class="block">Closes all streams and connections created by this <code>StorageConnector</code> except the given view. |
| This method closes all objects created by the <a href="#getStorageAs(java.lang.Class)"><code>getStorageAs(Class)</code></a> method except the given <code>view</code>. |
| If <code>view</code> is <code>null</code>, then this method closes everything including the <a href="#getStorage()">storage</a> if it is closeable. |
| |
| <p>This method is invoked when a suitable <a href="DataStore.html" title="class in org.apache.sis.storage"><code>DataStore</code></a> has been found - in which case the view used |
| by the data store is given in argument to this method - or when no suitable <code>DataStore</code> has been |
| found - in which case the <code>view</code> argument is null.</p> |
| |
| <p>This <code>StorageConnector</code> instance shall not be used anymore after invocation of this method.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>view</code> - the view to leave open, or <code>null</code> if none.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></code> - if an error occurred while closing the stream or database connection.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="#getStorageAs(java.lang.Class)"><code>getStorageAs(Class)</code></a></li> |
| <li><a href="DataStoreProvider.html#open(org.apache.sis.storage.StorageConnector)"><code>DataStoreProvider.open(StorageConnector)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="toString()"> |
| <h3>toString</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">toString</span>()</div> |
| <div class="block">Returns a string representation of this <code>StorageConnector</code> for debugging purpose. |
| This string representation is for diagnostic and may change in any future version.</div> |
| <dl class="notes"> |
| <dt>Overrides:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd> |
| <dt>Returns:</dt> |
| <dd>a string representation of this <code>StorageConnector</code> for debugging purpose.</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| <footer role="contentinfo"> |
| <hr> |
| <p class="legal-copy"><small>Copyright © 2010–2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </div> |
| </div> |
| </body> |
| </html> |