Skip to content

Commits on Source 6

language: java
jdk:
- oraclejdk7
- openjdk7
- oraclejdk8
# No need for preliminary install step.
......
plexus-utils2 (3.1.1-1) unstable; urgency=medium
* New upstream release
- Refreshed the patches
- Build depend on junit4 instead of junit
* Standards-Version updated to 4.3.0
-- Emmanuel Bourg <ebourg@apache.org> Fri, 28 Dec 2018 16:02:28 +0100
plexus-utils2 (3.1.0-4) unstable; urgency=medium
* Team upload.
......
......@@ -7,11 +7,11 @@ Build-Depends:
debhelper (>= 11),
default-jdk,
default-jdk-doc,
junit (>= 3.8.2),
junit4,
libmaven-javadoc-plugin-java,
libmaven-plugin-testing-java,
maven-debian-helper
Standards-Version: 4.2.1
Standards-Version: 4.3.0
Vcs-Git: https://salsa.debian.org/java-team/plexus-utils2.git
Vcs-Browser: https://salsa.debian.org/java-team/plexus-utils2
Homepage: http://codehaus-plexus.github.io/plexus-utils/
......
......@@ -16,7 +16,7 @@
# and version starting with 3., replacing the version with 3.x
# junit junit jar s/3\\..*/3.x/
junit junit jar s/3\..*/3.x/ * *
junit junit jar s/.*/4.x/ * *
org.codehaus.plexus plexus-utils jar s/.*/2.x/ * *
org.codehaus.plexus plexus pom s/.*/2.x/ * *
s/org.apache.maven.shared/org.apache.maven.plugin-testing/ maven-plugin-testing-harness * s/.*/debian/ * *
......
......@@ -15,4 +15,4 @@ Forwarded: not-needed
+ </dependency>
</dependencies>
<build>
<plugins>
<pluginManagement>
Description: Fixes CommandlineTest for Maven 3.5.4 or later
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: https://github.com/codehaus-plexus/plexus-utils/issues/48
--- a/src/test/java/org/codehaus/plexus/util/cli/CommandlineTest.java
+++ b/src/test/java/org/codehaus/plexus/util/cli/CommandlineTest.java
@@ -103,7 +103,6 @@
assertTrue( out.contains( "Apache Maven" ) );
assertTrue( out.contains( "Maven home:" ) );
assertTrue( out.contains( "Java version:" ) );
- assertTrue( out.contains( "Java home:" ) );
}
catch ( Exception e )
{
01-add-junit-dependency.patch
02-propertyutils-compatibility.patch
03-maven-plugin-testing-compatibility.patch
04-fix-test-failures.patch
05-fix-nio-file-copy.patch
......@@ -26,7 +26,7 @@ limitations under the License.
</parent>
<artifactId>plexus-utils</artifactId>
<version>3.1.0</version>
<version>3.1.1</version>
<name>Plexus Common Utilities</name>
<description>A collection of various utility classes to ease working with strings, files, command lines, XML and
......@@ -37,7 +37,7 @@ limitations under the License.
<connection>scm:git:git@github.com:codehaus-plexus/plexus-utils.git</connection>
<developerConnection>scm:git:git@github.com:codehaus-plexus/plexus-utils.git</developerConnection>
<url>http://github.com/codehaus-plexus/plexus-utils</url>
<tag>plexus-utils-3.1.0</tag>
<tag>plexus-utils-3.1.1</tag>
</scm>
<issueManagement>
<system>github</system>
......@@ -63,6 +63,15 @@ limitations under the License.
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
......
......@@ -130,10 +130,10 @@ public void setCaseSensitive( boolean isCaseSensitive )
}
/**
* Tests whether or not a given path matches the start of a given pattern up to the first "**".
* <p/>
* This is not a general purpose test and should only be used if you can live with false positives. For example,
* <code>pattern=**\a</code> and <code>str=b</code> will yield <code>true</code>.
* <p>Tests whether or not a given path matches the start of a given pattern up to the first "**".</p>
*
* <p>This is not a general purpose test and should only be used if you can live with false positives. For example,
* <code>pattern=**\a</code> and <code>str=b</code> will yield <code>true</code>.</p>
*
* @param pattern The pattern to match against. Must not be <code>null</code>.
* @param str The path to match, as a String. Must not be <code>null</code>.
......@@ -145,10 +145,10 @@ protected static boolean matchPatternStart( String pattern, String str )
}
/**
* Tests whether or not a given path matches the start of a given pattern up to the first "**".
* <p/>
* This is not a general purpose test and should only be used if you can live with false positives. For example,
* <code>pattern=**\a</code> and <code>str=b</code> will yield <code>true</code>.
* <p>Tests whether or not a given path matches the start of a given pattern up to the first "**".</p>
*
* <p>This is not a general purpose test and should only be used if you can live with false positives. For example,
* <code>pattern=**\a</code> and <code>str=b</code> will yield <code>true</code>.</p>
*
* @param pattern The pattern to match against. Must not be <code>null</code>.
* @param str The path to match, as a String. Must not be <code>null</code>.
......@@ -215,10 +215,10 @@ protected static boolean match( String pattern, String str, boolean isCaseSensit
}
/**
* Sets the list of include patterns to use. All '/' and '\' characters are replaced by
* <code>File.separatorChar</code>, so the separator used need not match <code>File.separatorChar</code>.
* <p/>
* When a pattern ends with a '/' or '\', "**" is appended.
* <p>Sets the list of include patterns to use. All '/' and '\' characters are replaced by
* <code>File.separatorChar</code>, so the separator used need not match <code>File.separatorChar</code>.</p>
*
* <p>When a pattern ends with a '/' or '\', "**" is appended.</p>
*
* @param includes A list of include patterns. May be <code>null</code>, indicating that all files should be
* included. If a non-<code>null</code> list is given, all elements must be non-<code>null</code>.
......@@ -244,10 +244,10 @@ public void setIncludes( String[] includes )
}
/**
* Sets the list of exclude patterns to use. All '/' and '\' characters are replaced by
* <code>File.separatorChar</code>, so the separator used need not match <code>File.separatorChar</code>.
* <p/>
* When a pattern ends with a '/' or '\', "**" is appended.
* <p>Sets the list of exclude patterns to use. All '/' and '\' characters are replaced by
* <code>File.separatorChar</code>, so the separator used need not match <code>File.separatorChar</code>.</p>
*
* <p>When a pattern ends with a '/' or '\', "**" is appended.</p>
*
* @param excludes A list of exclude patterns. May be <code>null</code>, indicating that no files should be
* excluded. If a non-<code>null</code> list is given, all elements must be non-<code>null</code>.
......
......@@ -60,56 +60,52 @@
import java.util.Vector;
/**
* Class for scanning a directory for files/directories which match certain criteria.
* <p/>
* These criteria consist of selectors and patterns which have been specified. With the selectors you can select which
* <p>Class for scanning a directory for files/directories which match certain criteria.</p>
*
* <p>These criteria consist of selectors and patterns which have been specified. With the selectors you can select which
* files you want to have included. Files which are not selected are excluded. With patterns you can include or exclude
* files based on their filename.
* <p/>
* The idea is simple. A given directory is recursively scanned for all files and directories. Each file/directory is
* files based on their filename.</p>
*
* <p>The idea is simple. A given directory is recursively scanned for all files and directories. Each file/directory is
* matched against a set of selectors, including special support for matching against filenames with include and and
* exclude patterns. Only files/directories which match at least one pattern of the include pattern list or other file
* selector, and don't match any pattern of the exclude pattern list or fail to match against a required selector will
* be placed in the list of files/directories found.
* <p/>
* When no list of include patterns is supplied, "**" will be used, which means that everything will be matched. When no
* be placed in the list of files/directories found.</p>
*
* <p>When no list of include patterns is supplied, "**" will be used, which means that everything will be matched. When no
* list of exclude patterns is supplied, an empty list is used, such that nothing will be excluded. When no selectors
* are supplied, none are applied.
* <p/>
* The filename pattern matching is done as follows: The name to be matched is split up in path segments. A path segment
* are supplied, none are applied.</p>
*
* <p>The filename pattern matching is done as follows: The name to be matched is split up in path segments. A path segment
* is the name of a directory or file, which is bounded by <code>File.separator</code> ('/' under UNIX, '\' under
* Windows). For example, "abc/def/ghi/xyz.java" is split up in the segments "abc", "def","ghi" and "xyz.java". The same
* is done for the pattern against which should be matched.
* <p/>
* The segments of the name and the pattern are then matched against each other. When '**' is used for a path segment in
* the pattern, it matches zero or more path segments of the name.
* <p/>
* There is a special case regarding the use of <code>File.separator</code>s at the beginning of the pattern and the
* is done for the pattern against which should be matched.</p>
*
* <p>The segments of the name and the pattern are then matched against each other. When '**' is used for a path segment in
* the pattern, it matches zero or more path segments of the name.</p>
*
* <p>There is a special case regarding the use of <code>File.separator</code>s at the beginning of the pattern and the
* string to match:<br>
* When a pattern starts with a <code>File.separator</code>, the string to match must also start with a
* <code>File.separator</code>. When a pattern does not start with a <code>File.separator</code>, the string to match
* may not start with a <code>File.separator</code>. When one of these rules is not obeyed, the string will not match.
* <p/>
* When a name path segment is matched against a pattern path segment, the following special characters can be used:<br>
* may not start with a <code>File.separator</code>. When one of these rules is not obeyed, the string will not match.</p>
*
* <p>When a name path segment is matched against a pattern path segment, the following special characters can be used:<br>
* '*' matches zero or more characters<br>
* '?' matches one character.
* <p/>
* '?' matches one character.</p>
*
* Examples:
* <p/>
* "**\*.class" matches all .class files/dirs in a directory tree.
* <p/>
* "test\a??.java" matches all files/dirs which start with an 'a', then two more characters and then ".java", in a
* directory called test.
* <p/>
* "**" matches everything in a directory tree.
* <p/>
* "**\test\**\XYZ*" matches all files/dirs which start with "XYZ" and where there is a parent directory called test
* (e.g. "abc\test\def\ghi\XYZ123").
* <p/>
* Case sensitivity may be turned off if necessary. By default, it is turned on.
* <p/>
* <ul>
* <li>"**\*.class" matches all .class files/dirs in a directory tree.</li>
* <li>"test\a??.java" matches all files/dirs which start with an 'a', then two more characters and then ".java", in a
* directory called test.</li>
* <li>"**" matches everything in a directory tree.</li>
* <li>"**\test\**\XYZ*" matches all files/dirs which start with "XYZ" and where there is a parent directory called test
* (e.g. "abc\test\def\ghi\XYZ123").</li>
* </ul>
*
* <p>Case sensitivity may be turned off if necessary. By default, it is turned on.</p>
* Example of usage:
*
* <pre>
* String[] includes = { "**\\*.class" };
* String[] excludes = { "modules\\*\\**" };
......@@ -121,14 +117,14 @@
*
* System.out.println( "FILES:" );
* String[] files = ds.getIncludedFiles();
* for ( int i = 0; i < files.length; i++ )
* for ( int i = 0; i &lt; files.length; i++ )
* {
* System.out.println( files[i] );
* }
* </pre>
*
* This will scan a directory called test for .class files, but excludes all files in all proper subdirectories of a
* directory called "modules"
* <p>This will scan a directory called test for .class files, but excludes all files in all proper subdirectories of a
* directory called "modules"</p>
*
* @author Arnout J. Kuiper <a href="mailto:ajkuiper@wxs.nl">ajkuiper@wxs.nl</a>
* @author Magesh Umasankar
......@@ -324,11 +320,11 @@ public void scan()
}
/**
* Top level invocation for a slow scan. A slow scan builds up a full list of excluded/included files/directories,
* <p>Top level invocation for a slow scan. A slow scan builds up a full list of excluded/included files/directories,
* whereas a fast scan will only have full results for included files, as it ignores directories which can't
* possibly hold any included files/directories.
* <p/>
* Returns immediately if a slow scan has already been completed.
* possibly hold any included files/directories.</p>
*
* <p>Returns immediately if a slow scan has already been completed.</p>
*/
protected void slowScan()
{
......@@ -586,14 +582,10 @@ public String[] getExcludedFiles()
}
/**
* <p>
* Returns the names of the files which were selected out and therefore not ultimately included.
* </p>
* <p/>
* <p>
* The names are relative to the base directory. This involves performing a slow scan if one has not already been
* completed.
* </p>
* <p>Returns the names of the files which were selected out and therefore not ultimately included.</p>
*
* <p>The names are relative to the base directory. This involves performing a slow scan if one has not already been
* completed.</p>
*
* @return the names of the files which were deselected.
* @see #slowScan
......@@ -653,14 +645,10 @@ public String[] getExcludedDirectories()
}
/**
* <p>
* Returns the names of the directories which were selected out and therefore not ultimately included.
* </p>
* <p/>
* <p>
* The names are relative to the base directory. This involves performing a slow scan if one has not already been
* completed.
* </p>
* <p>Returns the names of the directories which were selected out and therefore not ultimately included.</p>
*
* <p>The names are relative to the base directory. This involves performing a slow scan if one has not already been
* completed.</p>
*
* @return the names of the directories which were deselected.
* @see #slowScan
......@@ -674,10 +662,9 @@ public String[] getDeselectedDirectories()
}
/**
* Checks whether a given file is a symbolic link.
* <p/>
* <p>
* It doesn't really test for symbolic links but whether the canonical and absolute paths of the file are identical
* <p>Checks whether a given file is a symbolic link.</p>
*
* <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>
*
......@@ -700,12 +687,10 @@ public boolean isSymbolicLink( File parent, String name )
}
/**
* Checks whether the parent of this file is a symbolic link.
* <p/>
* <p>
* For java versions prior to 7 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>
* <p>Checks whether the parent of this file is a symbolic link.</p>
*
* <p>For java versions prior to 7 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>
*
* @param parent the parent directory of the file to test
* @param name the name of the file to test.
......
......@@ -81,12 +81,11 @@
import java.util.Random;
/**
* This class provides basic facilities for manipulating files and file paths.
* <p/>
* <p>This class provides basic facilities for manipulating files and file paths.</p>
*
* <h3>Path-related methods</h3>
* <p/>
* <p>
* Methods exist to retrieve the components of a typical file path. For example
*
* <p>Methods exist to retrieve the components of a typical file path. For example
* <code>/www/hosted/mysite/index.html</code>, can be broken into:
* <ul>
* <li><code>/www/hosted/mysite/</code> -- retrievable through {@link #getPath}</li>
......@@ -94,21 +93,19 @@
* <li><code>/www/hosted/mysite/index</code> -- retrievable through {@link #removeExtension}</li>
* <li><code>html</code> -- retrievable through {@link #getExtension}</li>
* </ul>
* There are also methods to {@link #catPath concatenate two paths}, {@link #resolveFile resolve a path relative to a
* File} and {@link #normalize} a path.
* </p>
* <p/>
* <p>There are also methods to {@link #catPath concatenate two paths}, {@link #resolveFile resolve a path relative to a
* File} and {@link #normalize} a path.</p>
* <h3>File-related methods</h3>
* <p/>
* There are methods to create a {@link #toFile File from a URL}, copy a {@link #copyFileToDirectory File to a
*
* <p>There are methods to create a {@link #toFile File from a URL}, copy a {@link #copyFileToDirectory File to a
* directory}, copy a {@link #copyFile File to another File}, copy a {@link #copyURLToFile URL's contents to a File}, as
* well as methods to {@link #deleteDirectory(File) delete} and {@link #cleanDirectory(File) clean} a directory.
* </p>
* <p/>
* Common {@link java.io.File} manipulation routines.
* <p/>
* Taken from the commons-utils repo. Also code from Alexandria's FileUtils. And from Avalon Excalibur's IO. And from
* Ant.
* well as methods to {@link #deleteDirectory(File) delete} and {@link #cleanDirectory(File) clean} a directory.</p>
*
* <p>Common {@link java.io.File} manipulation routines.</p>
*
* <p>Taken from the commons-utils repo. Also code from Alexandria's FileUtils. And from Avalon Excalibur's IO. And from
* Ant.</p>
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</A>
* @author <a href="mailto:sanders@codehaus.org">Scott Sanders</a>
......@@ -601,11 +598,11 @@ public static File getFile( String fileName )
}
/**
* Given a directory and an array of extensions return an array of compliant files.
* <p/>
* TODO Should an ignore list be passed in? TODO Should a recurse flag be passed in?
* <p/>
* The given extensions should be like "java" and not like ".java"
* <p>Given a directory and an array of extensions return an array of compliant files.</p>
*
* <p>TODO Should an ignore list be passed in? TODO Should a recurse flag be passed in?</p>
*
* <p>The given extensions should be like "java" and not like ".java"</p>
*
* @param directory The path of the directory.
* @param extensions an array of expected extensions.
......@@ -828,9 +825,9 @@ public static URL[] toURLs( final File[] files )
* Remove extension from filename. ie
*
* <pre>
* foo.txt --> foo
* a\b\c.jpg --> a\b\c
* a\b\c --> a\b\c
* foo.txt --&gt; foo
* a\b\c.jpg --&gt; a\b\c
* a\b\c --&gt; a\b\c
* </pre>
*
* @param filename the path of the file
......@@ -853,9 +850,9 @@ public static String removeExtension( final String filename )
* Get extension from filename. ie
*
* <pre>
* foo.txt --> "txt"
* a\b\c.jpg --> "jpg"
* a\b\c --> ""
* foo.txt --&gt; "txt"
* a\b\c.jpg --&gt; "jpg"
* a\b\c --&gt; ""
* </pre>
*
* @param filename the path of the file
......@@ -870,8 +867,8 @@ public static String getExtension( final String filename )
* Remove path from filename. Equivalent to the unix command <code>basename</code> ie.
*
* <pre>
* a/b/c.txt --> c.txt
* a.txt --> a.txt
* a/b/c.txt --&gt; c.txt
* a.txt --&gt; a.txt
* </pre>
*
* @param filepath the path of the file
......@@ -886,8 +883,8 @@ public static String removePath( final String filepath )
* Remove path from filename. ie.
*
* <pre>
* a/b/c.txt --> c.txt
* a.txt --> a.txt
* a/b/c.txt --&gt; c.txt
* a.txt --&gt; a.txt
* </pre>
*
* @param filepath the path of the file
......@@ -910,8 +907,8 @@ public static String removePath( final String filepath, final char fileSeparator
* Get path from filename. Roughly equivalent to the unix command <code>dirname</code>. ie.
*
* <pre>
* a/b/c.txt --> a/b
* a.txt --> ""
* a/b/c.txt --&gt; a/b
* a.txt --&gt; ""
* </pre>
*
* @param filepath the filepath
......@@ -926,8 +923,8 @@ public static String getPath( final String filepath )
* Get path from filename. ie.
*
* <pre>
* a/b/c.txt --> a/b
* a.txt --> ""
* a/b/c.txt --&gt; a/b
* a.txt --&gt; ""
* </pre>
*
* @param filepath the filepath
......@@ -1164,7 +1161,7 @@ private static void doCopyFileUsingNewIO( File source, File destination )
public static boolean copyFileIfModified( final File source, final File destination )
throws IOException
{
if ( destination.lastModified() < source.lastModified() )
if ( isSourceNewerThanDestination( source, destination ) )
{
copyFile( source, destination );
......@@ -1259,13 +1256,13 @@ private static void mkdirsFor( File destination )
* root. Eg:
*
* <pre>
* /foo// --> /foo/
* /foo/./ --> /foo/
* /foo/../bar --> /bar
* /foo/../bar/ --> /bar/
* /foo/../bar/../baz --> /baz
* //foo//./bar --> /foo/bar
* /../ --> null
* /foo// --&gt; /foo/
* /foo/./ --&gt; /foo/
* /foo/../bar --&gt; /bar
* /foo/../bar/ --&gt; /bar/
* /foo/../bar/../baz --&gt; /baz
* //foo//./bar --&gt; /foo/bar
* /../ --&gt; null
* </pre>
*
* @param path the path to normalize
......@@ -1317,14 +1314,15 @@ public static String normalize( final String path )
}
/**
* Will concatenate 2 paths. Paths with <code>..</code> will be properly handled.
* <p>
* Eg.,<br />
* <code>/a/b/c</code> + <code>d</code> = <code>/a/b/d</code><br />
* <code>/a/b/c</code> + <code>../d</code> = <code>/a/d</code><br />
* </p>
* <p/>
* Thieved from Tomcat sources...
* <p>Will concatenate 2 paths. Paths with <code>..</code> will be properly handled.</p>
*
* Eg.,
* <pre>
* /a/b/c + d = /a/b/d
* /a/b/c + ../d = /a/d
* </pre>
* <p>Thieved from Tomcat sources...</p>
*
* @param lookupPath a path
* @param path the path to concatenate
......@@ -2019,8 +2017,8 @@ public static void copyDirectory( File sourceDirectory, File destinationDirector
}
/**
* Copies a entire directory layout : no files will be copied only directories
* <p/>
* <p>Copies a entire directory layout : no files will be copied only directories</p>
*
* Note:
* <ul>
* <li>It will include empty directories.
......@@ -2095,8 +2093,8 @@ public static void copyDirectoryLayout( File sourceDirectory, File destinationDi
}
/**
* Copies a entire directory structure.
* <p/>
* <p>Copies a entire directory structure.</p>
*
* Note:
* <ul>
* <li>It will include empty directories.
......@@ -2114,8 +2112,8 @@ public static void copyDirectoryStructure( File sourceDirectory, File destinatio
}
/**
* Copies an entire directory structure but only source files with timestamp later than the destinations'.
* <p/>
* <p>Copies an entire directory structure but only source files with timestamp later than the destinations'.</p>
*
* Note:
* <ul>
* <li>It will include empty directories.
......@@ -2205,12 +2203,10 @@ else if ( file.isDirectory() )
}
/**
* Renames a file, even if that involves crossing file system boundaries.
* <p/>
* <p>
* This will remove <code>to</code> (if it exists), ensure that <code>to</code>'s parent directory exists and move
* <code>from</code>, which involves deleting <code>from</code> as well.
* </p>
* <p>Renames a file, even if that involves crossing file system boundaries.</p>
*
* <p>This will remove <code>to</code> (if it exists), ensure that <code>to</code>'s parent directory exists and move
* <code>from</code>, which involves deleting <code>from</code> as well.</p>
*
* @param from the file to move
* @param to the new file name
......@@ -2242,22 +2238,17 @@ public static void rename( File from, File to )
}
/**
* Create a temporary file in a given directory.
* <p/>
* <p>
* The file denoted by the returned abstract pathname did not exist before this method was invoked, any subsequent
* invocation of this method will yield a different file name.
* </p>
* <p/>
* The filename is prefixNNNNNsuffix where NNNN is a random number
* </p>
* <p>
* This method is different to {@link File#createTempFile(String, String, File)} of JDK 1.2 as it doesn't create the
* file itself. It uses the location pointed to by java.io.tmpdir when the parentDir attribute is null.
* </p>
* <p>
* To delete automatically the file created by this method, use the {@link File#deleteOnExit()} method.
* </p>
* <p>Create a temporary file in a given directory.</p>
*
* <p>The file denoted by the returned abstract pathname did not exist before this method was invoked, any subsequent
* invocation of this method will yield a different file name.</p>
*
* <p>The filename is prefixNNNNNsuffix where NNNN is a random number</p>
*
* <p>This method is different to {@link File#createTempFile(String, String, File)} of JDK 1.2 as it doesn't create the
* file itself. It uses the location pointed to by java.io.tmpdir when the parentDir attribute is null.</p>
*
* <p>To delete automatically the file created by this method, use the {@link File#deleteOnExit()} method.</p>
*
* @param prefix prefix before the random number
* @param suffix file extension; include the '.'
......@@ -2289,7 +2280,7 @@ public static File createTempFile( String prefix, String suffix, File parentDir
}
/**
* <b>If wrappers is null or empty, the file will be copy only if to.lastModified() < from.lastModified()</b>
* <b>If wrappers is null or empty, the file will be copy only if {@code to.lastModified() < from.lastModified()}</b>
*
* @param from the file to copy
* @param to the destination file
......@@ -2309,15 +2300,13 @@ public static abstract class FilterWrapper
}
/**
* <b>If wrappers is null or empty, the file will be copy only if to.lastModified() < from.lastModified() or if
* overwrite is true</b>
* <b>If wrappers is null or empty, the file will be copy only if {@code to.lastModified() < from.lastModified()}, if overwrite is true</b>
*
* @param from the file to copy
* @param to the destination file
* @param encoding the file output encoding (only if wrappers is not empty)
* @param wrappers array of {@link FilterWrapper}
* @param overwrite if true and f wrappers is null or empty, the file will be copy even if to.lastModified() <
* from.lastModified()
* @param overwrite if true and wrappers is null or empty, the file will be copied even if {@code to.lastModified() < from.lastModified()}
* @throws IOException if an IO error occurs during copying or filtering
* @since 1.5.2
*/
......@@ -2367,13 +2356,17 @@ public static void copyFile( File from, File to, String encoding, FilterWrapper[
}
else
{
if ( to.lastModified() < from.lastModified() || overwrite )
if ( isSourceNewerThanDestination( from, to ) || overwrite )
{
copyFile( from, to );
}
}
}
private static boolean isSourceNewerThanDestination( File source, File destination ) {
return ( destination.lastModified() == 0L && source.lastModified() == 0L ) || destination.lastModified() < source.lastModified();
}
/**
* Note: the file content is read with platform encoding
*
......@@ -2416,7 +2409,7 @@ public static List<String> loadFile( File file )
/**
* For Windows OS, check if the file name contains any of the following characters:
* <code>":", "*", "?", "\"", "<", ">", "|"</code>
* <code>":", "*", "?", "\"", "&lt;", "&gt;", "|"</code>
*
* @param f not null file
* @return <code>false</code> if the file path contains any of forbidden Windows characters, <code>true</code> if
......
......@@ -44,15 +44,13 @@
* <li>if the enclosed string is <em>not</em> found in the keyword Map, then no substitution is made; the token text is
* passed through unaltered.</li>
* </ul>
* <p>
* A token in the incoming character stream may be <em>escaped</em> by prepending an "escape sequence" which is
*
* <p>A token in the incoming character stream may be <em>escaped</em> by prepending an "escape sequence" which is
* specified to the constructor. An escaped token is passed through as written, with the escape sequence removed. This
* allows things which would look like tokens to be read literally rather than interpolated.
* </p>
* allows things which would look like tokens to be read literally rather than interpolated.</p>
*
* @author jdcasey Created on Feb 3, 2005
* @see InterpolationFilterReader
* @see org.codehaus.plexus.interpolation
*/
public class LineOrientedInterpolatingReader
extends FilterReader
......
......@@ -22,9 +22,9 @@
import java.util.StringTokenizer;
/**
* Describes a match target for SelectorUtils.
* <p/>
* Significantly more efficient than using strings, since re-evaluation and re-tokenizing is avoided.
* <p>Describes a match target for SelectorUtils.</p>
*
* <p>Significantly more efficient than using strings, since re-evaluation and re-tokenizing is avoided.</p>
*
* @author Kristian Rosenvold
*/
......
......@@ -19,9 +19,9 @@ private MatchPatterns( MatchPattern[] patterns )
}
/**
* Checks these MatchPatterns against a specified string.
* <p/>
* Uses far less string tokenization than any of the alternatives.
* <p>Checks these MatchPatterns against a specified string.</p>
*
* <p>Uses far less string tokenization than any of the alternatives.</p>
*
* @param name The name to look for
* @param isCaseSensitive If the comparison is case sensitive
......
......@@ -156,8 +156,8 @@ private static Set<String> setValidFamilies()
/**
* Sets the desired OS family type
*
* @param f The OS family type desired<br />
* Possible values:<br />
* @param f The OS family type desired<br>
* Possible values:
* <ul>
* <li>dos</li>
* <li>mac</li>
......
......@@ -30,13 +30,13 @@
public class PathTool
{
/**
* Determines the relative path of a filename from a base directory. This method is useful in building relative
* <p>Determines the relative path of a filename from a base directory. This method is useful in building relative
* links within pages of a web site. It provides similar functionality to Anakia's <code>$relativePath</code>
* context variable. The arguments to this method may contain either forward or backward slashes as file separators.
* The relative path returned is formed using forward slashes as it is expected this path is to be used as a link in
* a web page (again mimicking Anakia's behavior).
* <p/>
* This method is thread-safe. <br/>
* a web page (again mimicking Anakia's behavior).<p>
*
* <p>This method is thread-safe.</p>
*
* <pre>
* PathTool.getRelativePath( null, null ) = ""
......@@ -85,13 +85,13 @@ public static final String getRelativePath( String basedir, String filename )
}
/**
* Determines the relative path of a filename. This method is useful in building relative links within pages of a
* <p>Determines the relative path of a filename. This method is useful in building relative links within pages of a
* web site. It provides similar functionality to Anakia's <code>$relativePath</code> context variable. The argument
* to this method may contain either forward or backward slashes as file separators. The relative path returned is
* formed using forward slashes as it is expected this path is to be used as a link in a web page (again mimicking
* Anakia's behavior).
* <p/>
* This method is thread-safe.
* Anakia's behavior).</p>
*
* <p>This method is thread-safe.</p>
*
* @param filename The filename to be parsed.
* @return The relative path of the filename. This value is not terminated with a forward slash. A zero-length
......@@ -123,11 +123,11 @@ public static final String getRelativePath( String filename )
}
/**
* Determines the directory component of a filename. This is useful within DVSL templates when used in conjunction
* <p>Determines the directory component of a filename. This is useful within DVSL templates when used in conjunction
* with the DVSL's <code>$context.getAppValue("infilename")</code> to get the current directory that is currently
* being processed.
* <p/>
* This method is thread-safe. <br/>
* being processed.</p>
*
* <p>This method is thread-safe.</p>
*
* <pre>
* PathTool.getDirectoryComponent( null ) = ""
......@@ -159,7 +159,7 @@ public static final String getDirectoryComponent( String filename )
}
/**
* Calculates the appropriate link given the preferred link and the relativePath of the document. <br/>
* Calculates the appropriate link given the preferred link and the relativePath of the document.
*
* <pre>
* PathTool.calculateLink( "/index.html", "../.." ) = "../../index.html"
......@@ -227,7 +227,7 @@ public static final String calculateLink( String link, String relativePath )
}
/**
* This method can calculate the relative path between two paths on a web site. <br/>
* This method can calculate the relative path between two paths on a web site.
*
* <pre>
* PathTool.getRelativeWebPath( null, null ) = ""
......@@ -261,7 +261,7 @@ public static final String getRelativeWebPath( final String oldPath, final Strin
}
/**
* This method can calculate the relative path between two paths on a file system. <br/>
* This method can calculate the relative path between two paths on a file system.
*
* <pre>
* PathTool.getRelativeFilePath( null, null ) = ""
......
......@@ -60,14 +60,11 @@
import java.util.StringTokenizer;
/**
* <p>
* This is a utility class used by selectors and DirectoryScanner. The functionality more properly belongs just to
* <p>This is a utility class used by selectors and DirectoryScanner. The functionality more properly belongs just to
* selectors, but unfortunately DirectoryScanner exposed these as protected methods. Thus we have to support any
* subclasses of DirectoryScanner that may access these methods.
* </p>
* <p>
* This is a Singleton.
* </p>
* subclasses of DirectoryScanner that may access these methods.</p>
*
* <p>This is a Singleton.</p>
*
* @author Arnout J. Kuiper <a href="mailto:ajkuiper@wxs.nl">ajkuiper@wxs.nl</a>
* @author Magesh Umasankar
......@@ -104,10 +101,10 @@ public static SelectorUtils getInstance()
}
/**
* Tests whether or not a given path matches the start of a given pattern up to the first "**".
* <p/>
* This is not a general purpose test and should only be used if you can live with false positives. For example,
* <code>pattern=**\a</code> and <code>str=b</code> will yield <code>true</code>.
* <p>Tests whether or not a given path matches the start of a given pattern up to the first "**".</p>
*
* <p>This is not a general purpose test and should only be used if you can live with false positives. For example,
* <code>pattern=**\a</code> and <code>str=b</code> will yield <code>true</code>.</p>
*
* @param pattern The pattern to match against. Must not be <code>null</code>.
* @param str The path to match, as a String. Must not be <code>null</code>.
......@@ -119,10 +116,10 @@ public static boolean matchPatternStart( String pattern, String str )
}
/**
* Tests whether or not a given path matches the start of a given pattern up to the first "**".
* <p/>
* This is not a general purpose test and should only be used if you can live with false positives. For example,
* <code>pattern=**\a</code> and <code>str=b</code> will yield <code>true</code>.
* <p>Tests whether or not a given path matches the start of a given pattern up to the first "**".</p>
*
* <p>This is not a general purpose test and should only be used if you can live with false positives. For example,
* <code>pattern=**\a</code> and <code>str=b</code> will yield <code>true</code>.</p>
*
* @param pattern The pattern to match against. Must not be <code>null</code>.
* @param str The path to match, as a String. Must not be <code>null</code>.
......
......@@ -62,7 +62,7 @@
/**
* Wraps a String as an InputStream. Note that data will be lost for characters not in ISO Latin 1, as a simple
* char->byte mapping is assumed.
* char-&gt;byte mapping is assumed.
*
* @author <a href="mailto:umagesh@codehaus.org">Magesh Umasankar</a>
* @deprecated As of version 1.5.2 this class should no longer be used because it does not properly handle character
......
......@@ -157,7 +157,7 @@ public static String deleteWhitespace( String str )
/**
* <p>
* Checks if a String is non <code>null</code> and is not empty (<code>length > 0</code>).
* Checks if a String is non <code>null</code> and is not empty (<code>length &gt; 0</code>).
* </p>
*
* @param str the String to check
......@@ -1263,7 +1263,7 @@ else if ( ch < 32 )
* @param str String to repeat
* @param repeat number of times to repeat str
* @return String with repeated String
* @throws NegativeArraySizeException if <code>repeat < 0</code>
* @throws NegativeArraySizeException if <code>repeat &lt; 0</code>
* @throws NullPointerException if str is <code>null</code>
*/
public static String repeat( String str, int repeat )
......@@ -2199,7 +2199,7 @@ public static String abbreviate( String s, int offset, int maxWidth )
* Compare two strings, and return the portion where they differ. (More precisely, return the remainder of the
* second string, starting from where it's different from the first.)
* <p>
* E.g. strdiff("i am a machine", "i am a robot") -> "robot"
* E.g. strdiff("i am a machine", "i am a robot") -&gt; "robot"
*
* @return the portion of s2 where it differs from s1; returns the empty string ("") if they are equal
**/
......@@ -2216,7 +2216,7 @@ public static String difference( String s1, String s2 )
/**
* Compare two strings, and return the index at which the strings begin to differ.
* <p>
* E.g. strdiff("i am a machine", "i am a robot") -> 7
* E.g. strdiff("i am a machine", "i am a robot") -&gt; 7
* </p>
*
* @return the index where s2 and s1 begin to differ; -1 if they are equal
......
......@@ -53,22 +53,19 @@ public class SweeperPool
// private Vector used;
/**
* <p>
* There are a number of settings to control how the pool operates.
* <ul>
* <li><code>minSize</code> - this is the size the pool is trimmed to</li>
* <li><code>triggerSize</code> - this determines if the pool is trimmed when the sweeper runs. If the pool size is
* greater or equal than this value then the pool is trimmed to <code>minSize</code>.</lie>
* greater or equal than this value then the pool is trimmed to <code>minSize</code>.</li>
* <li><code>maxSize</code> - if the pool has reached this size, any objects added are immediately disposed. If the
* pool is this size when the sweeper runs, then the pool is also trimmed to <code>minSize</code> irrespective of
* the triggerSize.</li>
* <li><code>sweepInterval</code> - how often the sweeper runs. Is actually the time since the sweeper last finished
* a pass. 0 if the sweeper should not run.</li>
* </ul>
* </p>
* <p>
* Any value less than 0 is automatically converted to 0
* </p>
* <p>Any value less than 0 is automatically converted to 0</p>
*/
public SweeperPool( int maxSize, int minSize, int intialCapacity, int sweepInterval, int triggerSize )
{
......