blob: df2bf789db00bc530642507993ed86a8dcc3773f [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.4) on Fri Sep 20 12:10:30 CEST 2019 -->
<title>StorageConnector (Apache SIS 1.0 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2019-09-20">
<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="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="../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="StorageConnector (Apache SIS 1.0 API)";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../";
var useModuleDirectories = false;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">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">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.apache.sis.storage</a></div>
<h2 title="Class StorageConnector" class="title">Class StorageConnector</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></li>
<li>
<ul class="inheritance">
<li>StorageConnector</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a></code></dd>
</dl>
<hr>
<pre>public class <span class="typeNameLabel">StorageConnector</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>
implements <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a></pre>
<div class="block">Information for creating a connection to a <a href="DataStore.html" title="class in org.apache.sis.storage"><code>Data­Store</code></a> in read and/or write mode.
<code>Storage­Connector</code> wraps an input <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Object</code></a>, which can be any of the following types:
<ul>
<li>A <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file" class="externalLink"><code>Path</code></a> or a <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>File</code></a> for a file or a directory.</li>
<li>A <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>URI</code></a> or a <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>URL</code></a> to a distant resource.</li>
<li>A <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Char­Sequence</code></a> interpreted as a filename or a URL.</li>
<li>A <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/channels/Channel.html?is-external=true" title="class or interface in java.nio.channels" class="externalLink"><code>Channel</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/io/DataInput.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>Data­Input</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>Input­Stream</code></a> or <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>Reader</code></a>.</li>
<li>A <a href="https://docs.oracle.com/javase/8/docs/api/javax/sql/DataSource.html?is-external=true" title="class or interface in javax.sql" class="externalLink"><code>Data­Source</code></a> or a <a href="https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html?is-external=true" title="class or interface in java.sql" class="externalLink"><code>Connection</code></a> to a JDBC database.</li>
<li>Any other <code>Data­Store</code>-specific object, for example <a href="https://www.unidata.ucar.edu/software/netcdf-java/current/javadoc/ucar/nc2/NetcdfFile.html?is-external=true" title="class or interface in ucar.nc2" class="externalLink"><code>Netcdf­File</code></a>.</li>
</ul>
The <a href="#getStorageAs(java.lang.Class)"><code>get­Storage­As(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>get­Storage­As(…)</code> may return the same input stream.
<p>This class is used only for discovery of a <code>Data­Store</code> implementation capable to handle the input.
Once a suitable <code>Data­Store</code> has been found, the <code>Storage­Connector</code> instance is typically
discarded since each data store implementation will use their own input/output objects.</p>
<p>Instances of this class are serializable if the <code>storage</code> object given at construction time
is serializable.</p></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>0.3</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../serialized-form.html#org.apache.sis.storage.StorageConnector">Serialized Form</a></dd>
<p><font size="-1">Defined in the <code>sis-storage</code> module</font></p>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(java.lang.Object)">StorageConnector</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>&nbsp;storage)</code></th>
<td class="colLast">
<div class="block">Creates a new data store connection wrapping the given input/output object.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#closeAllExcept(java.lang.Object)">closeAllExcept</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>&nbsp;view)</code></th>
<td class="colLast">
<div class="block">Closes all streams and connections created by this <code>Storage­Connector</code> except the given view.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getFileExtension()">getFileExtension</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the filename extension of the input/output object.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getOption(org.apache.sis.setup.OptionKey)">getOption</a></span>&#8203;(<a href="../setup/OptionKey.html" title="class in org.apache.sis.setup">OptionKey</a>&lt;T&gt;&nbsp;key)</code></th>
<td class="colLast">
<div class="block">Returns the option value for the given key, or <code>null</code> if none.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getStorage()">getStorage</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the input/output object given at construction time.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getStorageAs(java.lang.Class)">getStorageAs</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a>&lt;T&gt;&nbsp;type)</code></th>
<td class="colLast">
<div class="block">Returns the storage as a view of the given type if possible, or <code>null</code> otherwise.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getStorageName()">getStorageName</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a short name of the input/output object.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setOption(org.apache.sis.setup.OptionKey,T)">setOption</a></span>&#8203;(<a href="../setup/OptionKey.html" title="class in org.apache.sis.setup">OptionKey</a>&lt;T&gt;&nbsp;key,
T&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Sets the option value for the given key.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString()">toString</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a string representation of this <code>Storage­Connector</code> for debugging purpose.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">get­Class</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hash­Code</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notify­All</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a id="&lt;init&gt;(java.lang.Object)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>StorageConnector</h4>
<pre>public&nbsp;StorageConnector&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>&nbsp;storage)</pre>
<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>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>storage</code> - the input/output object as a URL, file, image input stream, <i>etc.</i>.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="getOption(org.apache.sis.setup.OptionKey)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOption</h4>
<pre class="methodSignature">public&nbsp;&lt;T&gt;&nbsp;T&nbsp;getOption&#8203;(<a href="../setup/OptionKey.html" title="class in org.apache.sis.setup">OptionKey</a>&lt;T&gt;&nbsp;key)</pre>
<div class="block">Returns the option value for the given key, or <code>null</code> if none.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - the type of option value.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - the option for which to get the value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the current value for the given option, or <code>null</code> if none.</dd>
</dl>
</li>
</ul>
<a id="setOption(org.apache.sis.setup.OptionKey,java.lang.Object)">
<!-- -->
</a><a id="setOption(org.apache.sis.setup.OptionKey,T)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setOption</h4>
<pre class="methodSignature">public&nbsp;&lt;T&gt;&nbsp;void&nbsp;setOption&#8203;(<a href="../setup/OptionKey.html" title="class in org.apache.sis.setup">OptionKey</a>&lt;T&gt;&nbsp;key,
T&nbsp;value)</pre>
<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>Option­Key​.ENCODING</code></a> for decoding characters in an input stream, if needed.</li>
<li><a href="../setup/OptionKey.html#URL_ENCODING"><code>Option­Key​.URL_ENCODING</code></a> for converting URL to URI or filename, if needed.</li>
<li><a href="../setup/OptionKey.html#OPEN_OPTIONS"><code>Option­Key​.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>Option­Key​.BYTE_BUFFER</code></a> for allowing users to control the byte buffer to be created.</li>
</ul></div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - the type of option value.</dd>
<dt><span class="paramLabel">Parameters:</span></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>
</li>
</ul>
<a id="getStorage()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getStorage</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>&nbsp;getStorage()
throws <a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></pre>
<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>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the input/output object as a URL, file, image input stream, <i>etc.</i>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">Data­Store­Exception</a></code> - if the storage object has already been used and can not be reused.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#getStorageAs(java.lang.Class)"><code>get­Storage­As(Class)</code></a></dd>
</dl>
</li>
</ul>
<a id="getStorageName()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getStorageName</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;getStorageName()</pre>
<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/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file" class="externalLink"><code>Path</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>File</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>URI</code></a> or <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>URL</code></a>
instances, this method uses dedicated API like <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true#getFileName()" title="class or interface in java.nio.file" class="externalLink"><code>Path​.get­File­Name()</code></a>.</li>
<li>For <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Char­Sequence</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>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a short name of the storage object.</dd>
</dl>
</li>
</ul>
<a id="getFileExtension()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFileExtension</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;getFileExtension()</pre>
<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/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file" class="externalLink"><code>Path</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>File</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>URI</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>URL</code></a> or
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Char­Sequence</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>
<dt><span class="returnLabel">Returns:</span></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>
</li>
</ul>
<a id="getStorageAs(java.lang.Class)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getStorageAs</h4>
<pre class="methodSignature">public&nbsp;&lt;T&gt;&nbsp;T&nbsp;getStorageAs&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a>&lt;T&gt;&nbsp;type)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a>,
<a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></pre>
<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/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink"><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/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file" class="externalLink"><code>Path</code></a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>File</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>URL</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>URI</code></a> or <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Char­Sequence</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/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file" class="externalLink"><code>Path</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>URI</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>URL</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io" class="externalLink"><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/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file" class="externalLink"><code>Path</code></a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>File</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>URL</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>URI</code></a> or <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Char­Sequence</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/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio" class="externalLink"><code>Byte­Buffer</code></a>:
<ul>
<li>If the <a href="#getStorage()">storage</a> object can be obtained as described in bullet 2 of the
<code>Data­Input</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/javase/8/docs/api/java/io/DataInput.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>Data­Input</code></a>:
<ul>
<li>If the <a href="#getStorage()">storage</a> object is already an instance of <code>Data­Input</code>
(including the <a href="https://docs.oracle.com/javase/8/docs/api/javax/imageio/stream/ImageInputStream.html?is-external=true" title="class or interface in javax.imageio.stream" class="externalLink"><code>Image­Input­Stream</code></a> and <a href="https://docs.oracle.com/javase/8/docs/api/javax/imageio/stream/ImageOutputStream.html?is-external=true" title="class or interface in javax.imageio.stream" class="externalLink"><code>Image­Output­Stream</code></a> types),
then it is returned unchanged.</li>
<li>Otherwise if the input is an instance of <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file" class="externalLink"><code>Path</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>File</code></a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>URI</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>URL</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Char­Sequence</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>Input­Stream</code></a> or
<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/channels/ReadableByteChannel.html?is-external=true" title="class or interface in java.nio.channels" class="externalLink"><code>Readable­Byte­Channel</code></a>, then an <a href="https://docs.oracle.com/javase/8/docs/api/javax/imageio/stream/ImageInputStream.html?is-external=true" title="class or interface in javax.imageio.stream" class="externalLink"><code>Image­Input­Stream</code></a> backed by a
<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio" class="externalLink"><code>Byte­Buffer</code></a> is created when first needed and returned.</li>
<li>Otherwise if <a href="https://docs.oracle.com/javase/8/docs/api/javax/imageio/ImageIO.html?is-external=true#createImageInputStream(java.lang.Object)" title="class or interface in javax.imageio" class="externalLink"><code>Image­IO​.create­Image­Input­Stream(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/javase/8/docs/api/javax/imageio/stream/ImageInputStream.html?is-external=true" title="class or interface in javax.imageio.stream" class="externalLink"><code>Image­Input­Stream</code></a>:
<ul>
<li>If the above <code>Data­Input</code> can be created and casted to <code>Image­Input­Stream</code>, returns it.</li>
<li>Otherwise this method returns <code>null</code>.</li>
</ul>
</li>
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>Input­Stream</code></a>:
<ul>
<li>If the <a href="#getStorage()">storage</a> object is already an instance of <a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>Input­Stream</code></a>,
then it is returned unchanged.</li>
<li>Otherwise if the above <code>Image­Input­Stream</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/javase/8/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io" class="externalLink"><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/javase/8/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>Reader</code></a>,
then it is returned unchanged.</li>
<li>Otherwise if the above <code>Input­Stream</code> can be created, returns an <a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStreamReader.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>Input­Stream­Reader</code></a>
using the encoding specified by <a href="../setup/OptionKey.html#ENCODING"><code>Option­Key​.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/javase/8/docs/api/java/sql/Connection.html?is-external=true" title="class or interface in java.sql" class="externalLink"><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/javase/8/docs/api/java/sql/Connection.html?is-external=true" title="class or interface in java.sql" class="externalLink"><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/javase/8/docs/api/javax/sql/DataSource.html?is-external=true" title="class or interface in javax.sql" class="externalLink"><code>Data­Source</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/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Illegal­Argument­Exception</code></a>.</li>
</ul>
</li>
</ul>
Multiple invocations of this method on the same <code>Storage­Connector</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>Data­Store­Provider​.probe­Content(Storage­Connector)</code></a> methods shall not close the stream or
database connection returned by this method. In addition, those <code>probe­Content(Storage­Connector)</code>
methods are responsible for restoring the stream or byte buffer to its original position on return.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - the compile-time type of the <code>type</code> argument.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>type</code> - the desired type as one of <code>Byte­Buffer</code>, <code>Data­Input</code>, <code>Connection</code>
class or other type supported by <code>Storage­Connector</code> subclasses.</dd>
<dt><span class="returnLabel">Returns:</span></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><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">Illegal­Argument­Exception</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/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang" class="externalLink">Illegal­State­Exception</a></code> - if this <code>Storage­Connector</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">Data­Store­Exception</a></code> - if an error occurred while opening a stream or database connection.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#getStorage()"><code>get­Storage()</code></a>,
<a href="#closeAllExcept(java.lang.Object)"><code>close­All­Except(Object)</code></a></dd>
</dl>
</li>
</ul>
<a id="closeAllExcept(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>closeAllExcept</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;closeAllExcept&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>&nbsp;view)
throws <a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></pre>
<div class="block">Closes all streams and connections created by this <code>Storage­Connector</code> except the given view.
This method closes all objects created by the <a href="#getStorageAs(java.lang.Class)"><code>get­Storage­As(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>Data­Store</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>Data­Store</code> has been
found - in which case the <code>view</code> argument is null.</p>
<p>This <code>Storage­Connector</code> instance shall not be used anymore after invocation of this method.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>view</code> - the view to leave open, or <code>null</code> if none.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">Data­Store­Exception</a></code> - if an error occurred while closing the stream or database connection.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#getStorageAs(java.lang.Class)"><code>get­Storage­As(Class)</code></a>,
<a href="DataStoreProvider.html#open(org.apache.sis.storage.StorageConnector)"><code>Data­Store­Provider​.open(Storage­Connector)</code></a></dd>
</dl>
</li>
</ul>
<a id="toString()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;toString()</pre>
<div class="block">Returns a string representation of this <code>Storage­Connector</code> for debugging purpose.
This string representation is for debugging purpose only and may change in any future version.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">to­String</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a string representation of this <code>Storage­Connector</code> for debugging purpose.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">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">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &#169; 2010&#x2013;2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</body>
</html>