blob: 7c819ae46171aaaa07658c7d3f045c505b0d022e [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_161-google-v7) on Thu Oct 18 16:14:32 PDT 2018 -->
<title>ResourceId (Apache Beam 2.8.0-SNAPSHOT)</title>
<meta name="date" content="2018-10-18">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ResourceId (Apache Beam 2.8.0-SNAPSHOT)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</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">
<li><a href="../../../../../../org/apache/beam/sdk/io/fs/ResolveOptions.StandardResolveOptions.html" title="enum in org.apache.beam.sdk.io.fs"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceIdCoder.html" title="class in org.apache.beam.sdk.io.fs"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/beam/sdk/io/fs/ResourceId.html" target="_top">Frames</a></li>
<li><a href="ResourceId.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></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>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&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>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.beam.sdk.io.fs</div>
<h2 title="Interface ResourceId" class="title">Interface ResourceId</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd>java.io.Serializable</dd>
</dl>
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../../../org/apache/beam/sdk/extensions/gcp/storage/GcsResourceId.html" title="class in org.apache.beam.sdk.extensions.gcp.storage">GcsResourceId</a></dd>
</dl>
<hr>
<br>
<pre><a href="../../../../../../org/apache/beam/sdk/annotations/Experimental.html" title="annotation in org.apache.beam.sdk.annotations">@Experimental</a>(<a href="../../../../../../org/apache/beam/sdk/annotations/Experimental.html#value--">value</a>=<a href="../../../../../../org/apache/beam/sdk/annotations/Experimental.Kind.html#FILESYSTEM">FILESYSTEM</a>)
public interface <span class="typeNameLabel">ResourceId</span>
extends java.io.Serializable</pre>
<div class="block">An identifier which represents a file-like resource.
<p><a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs"><code>ResourceId</code></a> is hierarchical and composed of a sequence of directory and file name
elements separated by a special separator or delimiter.
<p><a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs"><code>ResourceIds</code></a> are created using <a href="../../../../../../org/apache/beam/sdk/io/FileSystems.html" title="class in org.apache.beam.sdk.io"><code>FileSystems</code></a>. The two primary
mechanisms are:
<ul>
<li><a href="../../../../../../org/apache/beam/sdk/io/FileSystems.html#match-java.util.List-"><code>FileSystems.match(java.util.List)</code></a>, which takes a list of <code>String</code> resource
names or globs, queries the <a href="../../../../../../org/apache/beam/sdk/io/FileSystem.html" title="class in org.apache.beam.sdk.io"><code>FileSystem</code></a> for resources matching these specifications,
and returns a <a href="../../../../../../org/apache/beam/sdk/io/fs/MatchResult.html" title="class in org.apache.beam.sdk.io.fs"><code>MatchResult</code></a> for each glob. This is typically used when reading from
files.
<li><a href="../../../../../../org/apache/beam/sdk/io/FileSystems.html#matchNewResource-java.lang.String-boolean-"><code>FileSystems.matchNewResource(String, boolean)</code></a>, which takes a <code>String</code> full
resource name and type (file or directory) and generates a <a href="../../../../../../org/apache/beam/sdk/io/FileSystem.html" title="class in org.apache.beam.sdk.io"><code>FileSystem</code></a>-specific
<code>ResourceId</code> for that resource. This call does not verify the presence or absence of
that resource in the file system. This call is typically used when creating new directories
or files to generate <a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs"><code>ResourceIds</code></a> for resources that may not yet exist.
</ul></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<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="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs">ResourceId</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html#getCurrentDirectory--">getCurrentDirectory</a></span>()</code>
<div class="block">Returns the <code>ResourceId</code> that represents the current directory of this <code>ResourceId</code>.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html#getFilename--">getFilename</a></span>()</code>
<div class="block">Returns the name of the file or directory denoted by this <code>ResourceId</code>.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html#getScheme--">getScheme</a></span>()</code>
<div class="block">Get the scheme which defines the namespace of the <a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs"><code>ResourceId</code></a>.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html#isDirectory--">isDirectory</a></span>()</code>
<div class="block">Returns <code>true</code> if this <a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs"><code>ResourceId</code></a> represents a directory, false otherwise.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs">ResourceId</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html#resolve-java.lang.String-org.apache.beam.sdk.io.fs.ResolveOptions-">resolve</a></span>(java.lang.String&nbsp;other,
<a href="../../../../../../org/apache/beam/sdk/io/fs/ResolveOptions.html" title="interface in org.apache.beam.sdk.io.fs">ResolveOptions</a>&nbsp;resolveOptions)</code>
<div class="block">Returns a child <code>ResourceId</code> under <code>this</code>.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html#toString--">toString</a></span>()</code>
<div class="block">Returns the string representation of this <a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs"><code>ResourceId</code></a>.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="resolve-java.lang.String-org.apache.beam.sdk.io.fs.ResolveOptions-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resolve</h4>
<pre><a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs">ResourceId</a>&nbsp;resolve(java.lang.String&nbsp;other,
<a href="../../../../../../org/apache/beam/sdk/io/fs/ResolveOptions.html" title="interface in org.apache.beam.sdk.io.fs">ResolveOptions</a>&nbsp;resolveOptions)</pre>
<div class="block">Returns a child <code>ResourceId</code> under <code>this</code>.
<p>In order to write file system agnostic code, callers should not include delimiters in <code>other</code>, and should use <a href="../../../../../../org/apache/beam/sdk/io/fs/ResolveOptions.StandardResolveOptions.html" title="enum in org.apache.beam.sdk.io.fs"><code>ResolveOptions.StandardResolveOptions</code></a> to specify whether to resolve a file or a
directory.
<p>For example:
<pre><code>
ResourceId homeDir = ...;
ResourceId tempOutput = homeDir
.resolve("tempDir", StandardResolveOptions.RESOLVE_DIRECTORY)
.resolve("output", StandardResolveOptions.RESOLVE_FILE);
</code></pre>
<p>This <a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs"><code>ResourceId</code></a> should represents a directory.
<p>It is up to each file system to resolve in their own way.
<p>Resolving special characters:
<ul>
<li><code>resourceId.resolve("..", StandardResolveOptions.RESOLVE_DIRECTORY)</code> returns the
parent directory of this <code>ResourceId</code>.
<li><code>resourceId.resolve("{@literal *}", StandardResolveOptions.RESOLVE_FILE)</code> returns a
<code>ResourceId</code> which matches all files in this <code>ResourceId</code>.
<li><code>resourceId.resolve("{@literal *}", StandardResolveOptions.RESOLVE_DIRECTORY)</code>
returns a <code>ResourceId</code> which matches all directories in this <code>ResourceId</code>.
</ul></div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - if this <a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs"><code>ResourceId</code></a> is not a directory.</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if <code>other</code> contains illegal characters or is an illegal
name. It is recommended that callers use common characters, such as <code>[_a-zA-Z0-9.-]</code>,
in <code>other</code>.</dd>
</dl>
</li>
</ul>
<a name="getCurrentDirectory--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCurrentDirectory</h4>
<pre><a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs">ResourceId</a>&nbsp;getCurrentDirectory()</pre>
<div class="block">Returns the <code>ResourceId</code> that represents the current directory of this <code>ResourceId</code>.
<p>If it is already a directory, trivially returns this.</div>
</li>
</ul>
<a name="getScheme--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getScheme</h4>
<pre>java.lang.String&nbsp;getScheme()</pre>
<div class="block">Get the scheme which defines the namespace of the <a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs"><code>ResourceId</code></a>.
<p>The scheme is required to follow URI scheme syntax. See <a
href="https://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a></div>
</li>
</ul>
<a name="getFilename--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFilename</h4>
<pre>@Nullable
java.lang.String&nbsp;getFilename()</pre>
<div class="block">Returns the name of the file or directory denoted by this <code>ResourceId</code>. The file name is
the farthest element from the root in the directory hierarchy.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a string representing the name of file or directory, or null if there are zero
components.</dd>
</dl>
</li>
</ul>
<a name="isDirectory--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isDirectory</h4>
<pre>boolean&nbsp;isDirectory()</pre>
<div class="block">Returns <code>true</code> if this <a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs"><code>ResourceId</code></a> represents a directory, false otherwise.</div>
</li>
</ul>
<a name="toString--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre>java.lang.String&nbsp;toString()</pre>
<div class="block">Returns the string representation of this <a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceId.html" title="interface in org.apache.beam.sdk.io.fs"><code>ResourceId</code></a>.
<p>The corresponding <a href="../../../../../../org/apache/beam/sdk/io/FileSystem.html#match-java.util.List-"><code>FileSystem.match(java.util.List&lt;java.lang.String&gt;)</code></a> is required to accept this string representation.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>toString</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</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">
<li><a href="../../../../../../org/apache/beam/sdk/io/fs/ResolveOptions.StandardResolveOptions.html" title="enum in org.apache.beam.sdk.io.fs"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../org/apache/beam/sdk/io/fs/ResourceIdCoder.html" title="class in org.apache.beam.sdk.io.fs"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/beam/sdk/io/fs/ResourceId.html" target="_top">Frames</a></li>
<li><a href="ResourceId.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.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>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&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>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>