????

Your IP : 216.73.216.152


Current Path : /opt/ant/manual/api/org/apache/tools/ant/util/
Upload File :
Current File : //opt/ant/manual/api/org/apache/tools/ant/util/SymbolicLinkUtils.html

<!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 (version 1.7.0_03) on Tue May 22 06:24:55 CEST 2012 -->
<title>SymbolicLinkUtils (Apache Ant API)</title>
<meta name="date" content="2012-05-22">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="SymbolicLinkUtils (Apache Ant API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><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/tools/ant/util/StringUtils.html" title="class in org.apache.tools.ant.util"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/tools/ant/util/TaskLogger.html" title="class in org.apache.tools.ant.util"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/tools/ant/util/SymbolicLinkUtils.html" target="_top">Frames</a></li>
<li><a href="SymbolicLinkUtils.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All 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><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 name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.tools.ant.util</div>
<h2 title="Class SymbolicLinkUtils" class="title">Class SymbolicLinkUtils</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.tools.ant.util.SymbolicLinkUtils</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">SymbolicLinkUtils</span>
extends java.lang.Object</pre>
<div class="block">Contains methods related to symbolic links - or what Ant thinks is
 a symbolic link based on the absent support for them in Java.</div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>Ant 1.8.0</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier</th>
<th class="colLast" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected </code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/util/SymbolicLinkUtils.html#SymbolicLinkUtils()">SymbolicLinkUtils</a></strong>()</code>
<div class="block">Empty constructor.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/util/SymbolicLinkUtils.html#deleteSymbolicLink(java.io.File, org.apache.tools.ant.Task)">deleteSymbolicLink</a></strong>(java.io.File&nbsp;link,
                  <a href="../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">Task</a>&nbsp;task)</code>
<div class="block">Delete a symlink (without deleting the associated resource).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/tools/ant/util/SymbolicLinkUtils.html" title="class in org.apache.tools.ant.util">SymbolicLinkUtils</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/util/SymbolicLinkUtils.html#getSymbolicLinkUtils()">getSymbolicLinkUtils</a></strong>()</code>
<div class="block">Method to retrieve The SymbolicLinkUtils, which is shared by
 all users of this method.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/util/SymbolicLinkUtils.html#isDanglingSymbolicLink(java.io.File)">isDanglingSymbolicLink</a></strong>(java.io.File&nbsp;file)</code>
<div class="block">Checks whether a given file is a broken symbolic link.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/util/SymbolicLinkUtils.html#isDanglingSymbolicLink(java.io.File, java.lang.String)">isDanglingSymbolicLink</a></strong>(java.io.File&nbsp;parent,
                      java.lang.String&nbsp;name)</code>
<div class="block">Checks whether a given file is a broken symbolic link.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/util/SymbolicLinkUtils.html#isDanglingSymbolicLink(java.lang.String)">isDanglingSymbolicLink</a></strong>(java.lang.String&nbsp;name)</code>
<div class="block">Checks whether a given file is a broken symbolic link.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/util/SymbolicLinkUtils.html#isSymbolicLink(java.io.File)">isSymbolicLink</a></strong>(java.io.File&nbsp;file)</code>
<div class="block">Checks whether a given file is a symbolic link.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/util/SymbolicLinkUtils.html#isSymbolicLink(java.io.File, java.lang.String)">isSymbolicLink</a></strong>(java.io.File&nbsp;parent,
              java.lang.String&nbsp;name)</code>
<div class="block">Checks whether a given file is a symbolic link.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/util/SymbolicLinkUtils.html#isSymbolicLink(java.lang.String)">isSymbolicLink</a></strong>(java.lang.String&nbsp;name)</code>
<div class="block">Checks whether a given file is a symbolic link.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="SymbolicLinkUtils()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SymbolicLinkUtils</h4>
<pre>protected&nbsp;SymbolicLinkUtils()</pre>
<div class="block">Empty constructor.</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="getSymbolicLinkUtils()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSymbolicLinkUtils</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/tools/ant/util/SymbolicLinkUtils.html" title="class in org.apache.tools.ant.util">SymbolicLinkUtils</a>&nbsp;getSymbolicLinkUtils()</pre>
<div class="block">Method to retrieve The SymbolicLinkUtils, which is shared by
 all users of this method.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>an instance of SymbolicLinkUtils.</dd></dl>
</li>
</ul>
<a name="isSymbolicLink(java.io.File)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSymbolicLink</h4>
<pre>public&nbsp;boolean&nbsp;isSymbolicLink(java.io.File&nbsp;file)
                       throws java.io.IOException</pre>
<div class="block">Checks whether a given file is a symbolic link.

 <p>It doesn't really test for symbolic links but whether the
 canonical and absolute paths of the file are identical--this
 may lead to false positives on some platforms.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>file</code> - the file to test.  Must not be null.</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if the file is a symbolic link.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - on error.</dd></dl>
</li>
</ul>
<a name="isSymbolicLink(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSymbolicLink</h4>
<pre>public&nbsp;boolean&nbsp;isSymbolicLink(java.lang.String&nbsp;name)
                       throws java.io.IOException</pre>
<div class="block">Checks whether a given file is a symbolic link.

 <p>It doesn't really test for symbolic links but whether the
 canonical and absolute paths of the file are identical--this
 may lead to false positives on some platforms.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - the name of the file to test.</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if the file is a symbolic link.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - on error.</dd></dl>
</li>
</ul>
<a name="isSymbolicLink(java.io.File, java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSymbolicLink</h4>
<pre>public&nbsp;boolean&nbsp;isSymbolicLink(java.io.File&nbsp;parent,
                     java.lang.String&nbsp;name)
                       throws java.io.IOException</pre>
<div class="block">Checks whether a given file is a symbolic link.

 <p>It doesn't really test for symbolic links but whether the
 canonical and absolute paths of the file are identical--this
 may lead to false positives on some platforms.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>parent</code> - the parent directory of the file to test</dd><dd><code>name</code> - the name of the file to test.</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if the file is a symbolic link.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - on error.</dd></dl>
</li>
</ul>
<a name="isDanglingSymbolicLink(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isDanglingSymbolicLink</h4>
<pre>public&nbsp;boolean&nbsp;isDanglingSymbolicLink(java.lang.String&nbsp;name)
                               throws java.io.IOException</pre>
<div class="block">Checks whether a given file is a broken symbolic link.

 <p>It doesn't really test for symbolic links but whether Java
 reports that the File doesn't exist but its parent's child list
 contains it--this may lead to false positives on some
 platforms.</p>

 <p>Note that #isSymbolicLink returns false if this method
 returns true since Java won't produce a canonical name
 different from the abolute one if the link is broken.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - the name of the file to test.</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if the file is a broken symbolic link.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - on error.</dd></dl>
</li>
</ul>
<a name="isDanglingSymbolicLink(java.io.File)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isDanglingSymbolicLink</h4>
<pre>public&nbsp;boolean&nbsp;isDanglingSymbolicLink(java.io.File&nbsp;file)
                               throws java.io.IOException</pre>
<div class="block">Checks whether a given file is a broken symbolic link.

 <p>It doesn't really test for symbolic links but whether Java
 reports that the File doesn't exist but its parent's child list
 contains it--this may lead to false positives on some
 platforms.</p>

 <p>Note that #isSymbolicLink returns false if this method
 returns true since Java won't produce a canonical name
 different from the abolute one if the link is broken.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>file</code> - the file to test.</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if the file is a broken symbolic link.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - on error.</dd></dl>
</li>
</ul>
<a name="isDanglingSymbolicLink(java.io.File, java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isDanglingSymbolicLink</h4>
<pre>public&nbsp;boolean&nbsp;isDanglingSymbolicLink(java.io.File&nbsp;parent,
                             java.lang.String&nbsp;name)
                               throws java.io.IOException</pre>
<div class="block">Checks whether a given file is a broken symbolic link.

 <p>It doesn't really test for symbolic links but whether Java
 reports that the File doesn't exist but its parent's child list
 contains it--this may lead to false positives on some
 platforms.</p>

 <p>Note that #isSymbolicLink returns false if this method
 returns true since Java won't produce a canonical name
 different from the abolute one if the link is broken.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>parent</code> - the parent directory of the file to test</dd><dd><code>name</code> - the name of the file to test.</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if the file is a broken symbolic link.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - on error.</dd></dl>
</li>
</ul>
<a name="deleteSymbolicLink(java.io.File, org.apache.tools.ant.Task)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>deleteSymbolicLink</h4>
<pre>public&nbsp;void&nbsp;deleteSymbolicLink(java.io.File&nbsp;link,
                      <a href="../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">Task</a>&nbsp;task)
                        throws java.io.IOException</pre>
<div class="block">Delete a symlink (without deleting the associated resource).

 <p>This is a utility method that removes a unix symlink without
 removing the resource that the symlink points to. If it is
 accidentally invoked on a real file, the real file will not be
 harmed, but silently ignored.</p>

 <p>Normaly this method works by
 getting the canonical path of the link, using the canonical path to
 rename the resource (breaking the link) and then deleting the link.
 The resource is then returned to its original name inside a finally
 block to ensure that the resource is unharmed even in the event of
 an exception.</p>

 <p>There may be cases where the algorithm described above doesn't work,
 in that case the method tries to use the native "rm" command on
 the symlink instead.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>link</code> - A <code>File</code> object of the symlink to delete.</dd><dd><code>task</code> - An Ant Task required if "rm" needs to be invoked.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - If calls to <code>File.rename</code>,
 <code>File.delete</code> or <code>File.getCanonicalPath</code>
 fail.</dd>
<dd><code>BuildException</code> - if the execution of "rm" failed.</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><a href="#skip-navbar_bottom" title="Skip navigation links"></a><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/tools/ant/util/StringUtils.html" title="class in org.apache.tools.ant.util"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/tools/ant/util/TaskLogger.html" title="class in org.apache.tools.ant.util"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/tools/ant/util/SymbolicLinkUtils.html" target="_top">Frames</a></li>
<li><a href="SymbolicLinkUtils.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All 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><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 name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>