commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1035190 - in /commons/proper/vfs/trunk: ./ core/src/main/java/org/apache/commons/vfs2/impl/ core/src/main/java/org/apache/commons/vfs2/provider/ core/src/main/java/org/apache/commons/vfs2/provider/local/ core/src/main/java/org/apache/commo...
Date Mon, 15 Nov 2010 08:58:38 GMT
Author: rgoers
Date: Mon Nov 15 08:58:37 2010
New Revision: 1035190

URL: http://svn.apache.org/viewvc?rev=1035190&view=rev
Log:
Sandbox was not dependent on vfs2. Convert many StringBuffers to StringBuilder. Convert HashMap
to ConcurrentHashMap in Messages class

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/VirtualFileName.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/CompositeFileProvider.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/DefaultURLStreamHandler.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/GenericFileName.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/HostFileNameParser.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/LayeredFileName.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/LayeredFileNameParser.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/URLFileName.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/URLFileNameParser.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/UriParser.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/GenericFileNameParser.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileName.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileNameParser.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/WindowsFileName.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/WindowsFileNameParser.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/res/ResourceFileProvider.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/temp/TemporaryFileProvider.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/url/UrlFileName.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Messages.java
    commons/proper/vfs/trunk/examples/pom.xml
    commons/proper/vfs/trunk/pom.xml
    commons/proper/vfs/trunk/sandbox/pom.xml
    commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileName.java
    commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileNameParser.java

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
Mon Nov 15 08:58:37 2010
@@ -761,7 +761,7 @@ public class DefaultFileSystemManager im
             realBase = base;
         }
 
-        final StringBuffer buffer = new StringBuffer(name);
+        final StringBuilder buffer = new StringBuilder(name);
 
         // Adjust separators
         UriParser.fixSeparators(buffer);

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/VirtualFileName.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/VirtualFileName.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/VirtualFileName.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/VirtualFileName.java
Mon Nov 15 08:58:37 2010
@@ -40,7 +40,7 @@ public class VirtualFileName extends Abs
     }
 
     @Override
-    protected void appendRootUri(StringBuffer buffer, boolean addPassword)
+    protected void appendRootUri(StringBuilder buffer, boolean addPassword)
     {
         buffer.append(getScheme());
     }

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java
Mon Nov 15 08:58:37 2010
@@ -46,8 +46,7 @@ public abstract class AbstractFileName
     private boolean calculateHashCode = true;
     private int calculatedHashCode;
 
-    public AbstractFileName(final String scheme,
-                            final String absPath, FileType type)
+    public AbstractFileName(final String scheme, final String absPath, FileType type)
     {
         this.rootUri = null;
         this.scheme = scheme;
@@ -147,10 +146,10 @@ public abstract class AbstractFileName
     /**
      * Builds the root URI for this file name.  Note that the root URI must not
      * end with a separator character.
-     * @param buffer A StringBuffer to use to construct the URI.
+     * @param buffer A StringBuilder to use to construct the URI.
      * @param addPassword true if the password should be added, false otherwise.
      */
-    protected abstract void appendRootUri(StringBuffer buffer, boolean addPassword);
+    protected abstract void appendRootUri(StringBuilder buffer, boolean addPassword);
 
     /**
      * Returns the base name of the file.
@@ -272,7 +271,7 @@ public abstract class AbstractFileName
 
     protected String createURI()
     {
-        final StringBuffer buffer = new StringBuffer();
+        final StringBuilder buffer = new StringBuilder();
         appendRootUri(buffer, true);
         buffer.append(getPath());
         return buffer.toString();
@@ -349,7 +348,7 @@ public abstract class AbstractFileName
     {
         if (rootUri == null)
         {
-            final StringBuffer buffer = new StringBuffer();
+            final StringBuilder buffer = new StringBuilder();
             appendRootUri(buffer, true);
             buffer.append(SEPARATOR_CHAR);
             rootUri = buffer.toString().intern();
@@ -548,7 +547,7 @@ public abstract class AbstractFileName
      */
     public String getFriendlyURI()
     {
-        final StringBuffer buffer = new StringBuffer();
+        final StringBuilder buffer = new StringBuilder();
         appendRootUri(buffer, false);
         buffer.append(getPath());
         return buffer.toString();

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java
Mon Nov 15 08:58:37 2010
@@ -427,7 +427,7 @@ public abstract class AbstractFileObject
      */
     public URL getURL() throws FileSystemException
     {
-        final StringBuffer buf = new StringBuffer();
+        final StringBuilder buf = new StringBuilder();
         try
         {
             return AccessController.doPrivileged(new PrivilegedExceptionAction<URL>()

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/CompositeFileProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/CompositeFileProvider.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/CompositeFileProvider.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/CompositeFileProvider.java
Mon Nov 15 08:58:37 2010
@@ -53,7 +53,7 @@ public abstract class CompositeFileProvi
                                final FileSystemOptions fileSystemOptions)
         throws FileSystemException
     {
-        StringBuffer buf = new StringBuffer(INITIAL_BUFSZ);
+        StringBuilder buf = new StringBuilder(INITIAL_BUFSZ);
 
         UriParser.extractScheme(uri, buf);
 

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/DefaultURLStreamHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/DefaultURLStreamHandler.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/DefaultURLStreamHandler.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/DefaultURLStreamHandler.java
Mon Nov 15 08:58:37 2010
@@ -86,7 +86,7 @@ public class DefaultURLStreamHandler
             }
 
             final String url = newURL.getName().getURI();
-            final StringBuffer filePart = new StringBuffer();
+            final StringBuilder filePart = new StringBuilder();
             final String protocolPart = UriParser.extractScheme(url, filePart);
 
             setURL(u, protocolPart, "", -1, null, null, filePart.toString(), null, null);

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/GenericFileName.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/GenericFileName.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/GenericFileName.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/GenericFileName.java
Mon Nov 15 08:58:37 2010
@@ -131,7 +131,7 @@ public class GenericFileName extends Abs
      * Builds the root URI for this file name.
      */
     @Override
-    protected void appendRootUri(final StringBuffer buffer, boolean addPassword)
+    protected void appendRootUri(final StringBuilder buffer, boolean addPassword)
     {
         buffer.append(getScheme());
         buffer.append("://");
@@ -147,7 +147,7 @@ public class GenericFileName extends Abs
     /**
      * append the user credentials
      */
-    protected void appendCredentials(StringBuffer buffer, boolean addPassword)
+    protected void appendCredentials(StringBuilder buffer, boolean addPassword)
     {
         if (userName != null && userName.length() != 0)
         {

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/HostFileNameParser.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/HostFileNameParser.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/HostFileNameParser.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/HostFileNameParser.java
Mon Nov 15 08:58:37 2010
@@ -55,7 +55,7 @@ public class HostFileNameParser extends 
             throws FileSystemException
     {
         // FTP URI are generic URI (as per RFC 2396)
-        final StringBuffer name = new StringBuffer();
+        final StringBuilder name = new StringBuilder();
 
         // Extract the scheme and authority parts
         final Authority auth = extractToPath(filename, name);
@@ -85,7 +85,7 @@ public class HostFileNameParser extends 
      * @param name Used to return the remainder of the URI.
      */
     protected Authority extractToPath(final String uri,
-                                      final StringBuffer name)
+                                      final StringBuilder name)
         throws FileSystemException
     {
         final Authority auth = new Authority();
@@ -163,7 +163,7 @@ public class HostFileNameParser extends 
      * Extracts the user info from a URI.  The scheme:// part has been removed
      * already.
      */
-    protected String extractUserInfo(final StringBuffer name)
+    protected String extractUserInfo(final StringBuilder name)
     {
         final int maxlen = name.length();
         for (int pos = 0; pos < maxlen; pos++)
@@ -191,7 +191,7 @@ public class HostFileNameParser extends 
      * Extracts the hostname from a URI.  The scheme://userinfo@ part has
      * been removed.
      */
-    protected String extractHostName(final StringBuffer name)
+    protected String extractHostName(final StringBuilder name)
     {
         final int maxlen = name.length();
         int pos = 0;
@@ -221,7 +221,7 @@ public class HostFileNameParser extends 
      *
      * @return The port, or -1 if the URI does not contain a port.
      */
-    protected int extractPort(final StringBuffer name, final String uri) throws FileSystemException
+    protected int extractPort(final StringBuilder name, final String uri) throws FileSystemException
     {
         if (name.length() < 1 || name.charAt(0) != ':')
         {

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/LayeredFileName.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/LayeredFileName.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/LayeredFileName.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/LayeredFileName.java
Mon Nov 15 08:58:37 2010
@@ -60,7 +60,7 @@ public class LayeredFileName extends Abs
     }
 
     @Override
-    protected void appendRootUri(StringBuffer buffer, boolean addPassword)
+    protected void appendRootUri(StringBuilder buffer, boolean addPassword)
     {
         buffer.append(getScheme());
         buffer.append(":");

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/LayeredFileNameParser.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/LayeredFileNameParser.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/LayeredFileNameParser.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/LayeredFileNameParser.java
Mon Nov 15 08:58:37 2010
@@ -61,7 +61,7 @@ public class LayeredFileNameParser exten
     public FileName parseUri(final VfsComponentContext context, FileName base, final String
filename)
             throws FileSystemException
     {
-        final StringBuffer name = new StringBuffer();
+        final StringBuilder name = new StringBuilder();
 
         // Extract the scheme
         final String scheme = UriParser.extractScheme(filename, name);
@@ -86,7 +86,7 @@ public class LayeredFileNameParser exten
     /**
      * Pops the root prefix off a URI, which has had the scheme removed.
      */
-    protected String extractRootName(final StringBuffer uri)
+    protected String extractRootName(final StringBuilder uri)
         throws FileSystemException
     {
         // Looking for <name>!<abspath> (staring at the end)

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/URLFileName.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/URLFileName.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/URLFileName.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/URLFileName.java
Mon Nov 15 08:58:37 2010
@@ -62,7 +62,7 @@ public class URLFileName extends Generic
      */
     public String getPathQuery()
     {
-        StringBuffer sb = new StringBuffer(BUFFSZ);
+        StringBuilder sb = new StringBuilder(BUFFSZ);
         sb.append(getPath());
         sb.append("?");
         sb.append(getQueryString());
@@ -92,7 +92,7 @@ public class URLFileName extends Generic
             }
         }
 
-        StringBuffer sb = new StringBuffer(BUFFSZ);
+        StringBuilder sb = new StringBuilder(BUFFSZ);
         if (charset != null)
         {
             sb.append(URIUtil.encodePath(getPathDecoded(), charset));
@@ -136,7 +136,7 @@ public class URLFileName extends Generic
     {
         if (getQueryString() != null)
         {
-            StringBuffer sb = new StringBuffer(BUFFSZ);
+            StringBuilder sb = new StringBuilder(BUFFSZ);
             sb.append(super.createURI());
             sb.append("?");
             sb.append(getQueryString());
@@ -156,7 +156,7 @@ public class URLFileName extends Generic
      */
     public String getURIEncoded(String charset) throws FileSystemException, URIException
     {
-        StringBuffer sb = new StringBuffer(BUFFSZ);
+        StringBuilder sb = new StringBuilder(BUFFSZ);
         appendRootUri(sb, true);
         sb.append(getPathQueryEncoded(charset));
         return sb.toString();

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/URLFileNameParser.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/URLFileNameParser.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/URLFileNameParser.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/URLFileNameParser.java
Mon Nov 15 08:58:37 2010
@@ -45,7 +45,7 @@ public class URLFileNameParser extends H
             throws FileSystemException
     {
         // FTP URI are generic URI (as per RFC 2396)
-        final StringBuffer name = new StringBuffer();
+        final StringBuilder name = new StringBuilder();
 
         // Extract the scheme and authority parts
         final Authority auth = extractToPath(filename, name);

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/UriParser.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/UriParser.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/UriParser.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/UriParser.java
Mon Nov 15 08:58:37 2010
@@ -58,7 +58,7 @@ public final class UriParser
      * @param name StringBuffer containing the path.
      * @return The first element of the path.
      */
-    public static String extractFirstElement(final StringBuffer name)
+    public static String extractFirstElement(final StringBuilder name)
     {
         final int len = name.length();
         if (len < 1)
@@ -103,7 +103,7 @@ public final class UriParser
      *
      *  @see #fixSeparators
      */
-    public static FileType normalisePath(final StringBuffer path)
+    public static FileType normalisePath(final StringBuilder path)
             throws FileSystemException
     {
         FileType fileType = FileType.FOLDER;
@@ -202,7 +202,7 @@ public final class UriParser
      * @param name The StringBuffer containing the name
      * @return true if the StringBuffer was modified.
      */
-    public static boolean fixSeparators(final StringBuffer name)
+    public static boolean fixSeparators(final StringBuilder name)
     {
         boolean changed = false;
         final int maxlen = name.length();
@@ -237,7 +237,7 @@ public final class UriParser
      * @param buffer Returns the remainder of the URI.
      * @return The scheme name. Returns null if there is no scheme.
      */
-    public static String extractScheme(final String uri, final StringBuffer buffer)
+    public static String extractScheme(final String uri, final StringBuilder buffer)
     {
         if (buffer != null)
         {
@@ -305,7 +305,7 @@ public final class UriParser
         {
             return encodedStr;
         }
-        final StringBuffer buffer = new StringBuffer(encodedStr);
+        final StringBuilder buffer = new StringBuilder(encodedStr);
         decode(buffer, 0, buffer.length());
         return buffer.toString();
     }
@@ -317,7 +317,7 @@ public final class UriParser
      * @param length The number of characters to decode.
      * @throws FileSystemException if an error occurs.
      */
-    public static void decode(final StringBuffer buffer, final int offset, final int length)
+    public static void decode(final StringBuilder buffer, final int offset, final int length)
             throws FileSystemException
     {
         int index = offset;
@@ -360,7 +360,7 @@ public final class UriParser
      * @param unencodedValue The String to encode and append.
      * @param reserved characters to encode.
      */
-    public static void appendEncoded(final StringBuffer buffer,
+    public static void appendEncoded(final StringBuilder buffer,
             final String unencodedValue, final char[] reserved)
     {
         final int offset = buffer.length();
@@ -376,7 +376,7 @@ public final class UriParser
      * @param length The number of characters to encode.
      * @param reserved characters to encode.
      */
-    public static void encode(final StringBuffer buffer, final int offset,
+    public static void encode(final StringBuilder buffer, final int offset,
             final int length, final char[] reserved)
     {
         int index = offset;
@@ -430,7 +430,7 @@ public final class UriParser
         {
             return null;
         }
-        final StringBuffer buffer = new StringBuffer(decodedStr);
+        final StringBuilder buffer = new StringBuilder(decodedStr);
         encode(buffer, 0, buffer.length(), reserved);
         return buffer.toString();
     }
@@ -463,7 +463,7 @@ public final class UriParser
         decode(uri);
     }
 
-    public static void canonicalizePath(StringBuffer buffer, int offset,
+    public static void canonicalizePath(StringBuilder buffer, int offset,
             int length, FileNameParser fileNameParser)
             throws FileSystemException
     {
@@ -526,7 +526,7 @@ public final class UriParser
      * @param name StringBuffer containing the URI.
      * @return The query string, if any. null otherwise.
      */
-    public static String extractQueryString(StringBuffer name)
+    public static String extractQueryString(StringBuilder name)
     {
         for (int pos = 0; pos < name.length(); pos++)
         {

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/GenericFileNameParser.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/GenericFileNameParser.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/GenericFileNameParser.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/GenericFileNameParser.java
Mon Nov 15 08:58:37 2010
@@ -46,7 +46,7 @@ public class GenericFileNameParser
      */
     @Override
     protected String extractRootPrefix(final String uri,
-                                       final StringBuffer name)
+                                       final StringBuilder name)
         throws FileSystemException
     {
         // TODO - this class isn't generic at all.  Need to fix this

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileName.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileName.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileName.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileName.java
Mon Nov 15 08:58:37 2010
@@ -64,7 +64,7 @@ public class LocalFileName extends Abstr
      * Builds the root URI for this file name.
      */
     @Override
-    protected void appendRootUri(final StringBuffer buffer, boolean addPassword)
+    protected void appendRootUri(final StringBuilder buffer, boolean addPassword)
     {
         buffer.append(getScheme());
         buffer.append("://");

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileNameParser.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileNameParser.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileNameParser.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileNameParser.java
Mon Nov 15 08:58:37 2010
@@ -39,7 +39,7 @@ public abstract class LocalFileNameParse
     public boolean isAbsoluteName(final String name)
     {
         // TODO - this is yucky
-        StringBuffer b = new StringBuffer(name);
+        StringBuilder b = new StringBuilder(name);
         try
         {
             UriParser.fixSeparators(b);
@@ -56,14 +56,14 @@ public abstract class LocalFileNameParse
      * Pops the root prefix off a URI, which has had the scheme removed.
      */
     protected abstract String extractRootPrefix(final String uri,
-                                                final StringBuffer name)
+                                                final StringBuilder name)
         throws FileSystemException;
 
 
     public FileName parseUri(final VfsComponentContext context, FileName base, final String
filename)
         throws FileSystemException
     {
-        final StringBuffer name = new StringBuffer();
+        final StringBuilder name = new StringBuilder();
 
         // Extract the scheme
         String scheme = UriParser.extractScheme(filename, name);

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/WindowsFileName.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/WindowsFileName.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/WindowsFileName.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/WindowsFileName.java
Mon Nov 15 08:58:37 2010
@@ -51,7 +51,7 @@ public class WindowsFileName extends Loc
      * Builds the root URI for this file name.
      */
     @Override
-    protected void appendRootUri(final StringBuffer buffer, boolean addPassword)
+    protected void appendRootUri(final StringBuilder buffer, boolean addPassword)
     {
         buffer.append(getScheme());
         buffer.append("://");

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/WindowsFileNameParser.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/WindowsFileNameParser.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/WindowsFileNameParser.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/WindowsFileNameParser.java
Mon Nov 15 08:58:37 2010
@@ -26,15 +26,14 @@ import org.apache.commons.vfs2.FileType;
  * @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
  * @version $Revision$ $Date$
  */
-public class WindowsFileNameParser
-    extends LocalFileNameParser
+public class WindowsFileNameParser extends LocalFileNameParser
 {
     /**
      * Pops the root prefix off a URI, which has had the scheme removed.
      */
     @Override
     protected String extractRootPrefix(final String uri,
-                                       final StringBuffer name)
+                                       final StringBuilder name)
         throws FileSystemException
     {
         return extractWindowsRootPrefix(uri, name);
@@ -50,7 +49,7 @@ public class WindowsFileNameParser
      * Extracts a Windows root prefix from a name.
      */
     private String extractWindowsRootPrefix(final String uri,
-                                            final StringBuffer name)
+                                            final StringBuilder name)
         throws FileSystemException
     {
         // Looking for:
@@ -89,7 +88,7 @@ public class WindowsFileNameParser
     /**
      * Extracts a drive prefix from a path.  Leading '/' chars have been removed.
      */
-    private String extractDrivePrefix(final StringBuffer name)
+    private String extractDrivePrefix(final StringBuilder name)
     {
         // Looking for <letter> ':' '/'
         if (name.length() < 3)
@@ -124,7 +123,7 @@ public class WindowsFileNameParser
      * Extracts a UNC name from a path.  Leading '/' chars have been removed.
      */
     private String extractUNCPrefix(final String uri,
-                                    final StringBuffer name)
+                                    final StringBuilder name)
         throws FileSystemException
     {
         // Looking for <name> '/' <name> ( '/' | <end> )

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/res/ResourceFileProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/res/ResourceFileProvider.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/res/ResourceFileProvider.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/res/ResourceFileProvider.java
Mon Nov 15 08:58:37 2010
@@ -63,7 +63,7 @@ public class ResourceFileProvider extend
                                final FileSystemOptions fileSystemOptions)
         throws FileSystemException
     {
-        StringBuffer buf = new StringBuffer(80);
+        StringBuilder buf = new StringBuilder(80);
         UriParser.extractScheme(uri, buf);
         String resourceName = buf.toString();
 

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/temp/TemporaryFileProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/temp/TemporaryFileProvider.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/temp/TemporaryFileProvider.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/temp/TemporaryFileProvider.java
Mon Nov 15 08:58:37 2010
@@ -99,7 +99,7 @@ public class TemporaryFileProvider
         throws FileSystemException
     {
         // Parse the name
-        final StringBuffer buffer = new StringBuffer(uri);
+        final StringBuilder buffer = new StringBuilder(uri);
         final String scheme = UriParser.extractScheme(uri, buffer);
 
         UriParser.fixSeparators(buffer);

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/url/UrlFileName.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/url/UrlFileName.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/url/UrlFileName.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/url/UrlFileName.java
Mon Nov 15 08:58:37 2010
@@ -45,7 +45,7 @@ public class UrlFileName extends URLFile
     }
 
     @Override
-    protected void appendRootUri(final StringBuffer buffer, boolean addPassword)
+    protected void appendRootUri(final StringBuilder buffer, boolean addPassword)
     {
         if (getHostName() != null && !"".equals(getHostName()))
         {

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Messages.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Messages.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Messages.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Messages.java
Mon Nov 15 08:58:37 2010
@@ -17,10 +17,10 @@
 package org.apache.commons.vfs2.util;
 
 import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.Map;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 
 /**
  * Formats messages.
@@ -33,7 +33,8 @@ public final class Messages
     /**
      * Map from message code to MessageFormat object for the message.
      */
-    private static Map<String, MessageFormat> messages = new HashMap<String, MessageFormat>();
+    private static ConcurrentMap<String, MessageFormat> messages =
+        new ConcurrentHashMap<String, MessageFormat>();
     private static ResourceBundle resources;
 
     private Messages()
@@ -91,7 +92,7 @@ public final class Messages
     /**
      * Locates a message by its code.
      */
-    private static synchronized MessageFormat findMessage(final String code)
+    private static MessageFormat findMessage(final String code)
         throws MissingResourceException
     {
         // Check if the message is cached
@@ -108,7 +109,7 @@ public final class Messages
         }
         final String msgText = resources.getString(code);
         msg = new MessageFormat(msgText);
-        messages.put(code, msg);
-        return msg;
+        messages.putIfAbsent(code, msg);
+        return messages.get(code);
     }
 }

Modified: commons/proper/vfs/trunk/examples/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/examples/pom.xml?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/examples/pom.xml (original)
+++ commons/proper/vfs/trunk/examples/pom.xml Mon Nov 15 08:58:37 2010
@@ -37,7 +37,7 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.commons</groupId>
-      <artifactId>commons-vfs</artifactId>
+      <artifactId>commons-vfs2</artifactId>
     </dependency>
 
     <dependency>

Modified: commons/proper/vfs/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/pom.xml?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/pom.xml (original)
+++ commons/proper/vfs/trunk/pom.xml Mon Nov 15 08:58:37 2010
@@ -274,12 +274,12 @@
       <!-- artifacts of project, versions managed by release-plugin -->
       <dependency>
         <groupId>org.apache.commons</groupId>
-        <artifactId>commons-vfs</artifactId>
+        <artifactId>commons-vfs2</artifactId>
         <version>${project.version}</version>
       </dependency>
       <dependency>
         <groupId>org.apache.commons</groupId>
-        <artifactId>commons-vfs</artifactId>
+        <artifactId>commons-vfs2</artifactId>
         <version>${project.version}</version>
         <type>test-jar</type>
         <scope>test</scope>

Modified: commons/proper/vfs/trunk/sandbox/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/sandbox/pom.xml?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/sandbox/pom.xml (original)
+++ commons/proper/vfs/trunk/sandbox/pom.xml Mon Nov 15 08:58:37 2010
@@ -37,7 +37,7 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.commons</groupId>
-      <artifactId>commons-vfs</artifactId>
+      <artifactId>commons-vfs2</artifactId>
     </dependency>
 
     <dependency>
@@ -61,7 +61,7 @@
     </dependency>
     <dependency>
        <groupId>org.apache.commons</groupId>
-       <artifactId>commons-vfs</artifactId>
+       <artifactId>commons-vfs2</artifactId>
        <type>test-jar</type>
      </dependency>
     <dependency>

Modified: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileName.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileName.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileName.java
(original)
+++ commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileName.java
Mon Nov 15 08:58:37 2010
@@ -27,8 +27,7 @@ import org.apache.commons.vfs2.provider.
  * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  * @version $Revision$ $Date$
  */
-public class SmbFileName
-    extends GenericFileName
+public class SmbFileName extends GenericFileName
 {
     private static final int DEFAULT_PORT = 139;
 
@@ -64,7 +63,7 @@ public class SmbFileName
      * Builds the root URI for this file name.
      */
     @Override
-    protected void appendRootUri(final StringBuffer buffer, boolean addPassword)
+    protected void appendRootUri(final StringBuilder buffer, boolean addPassword)
     {
         super.appendRootUri(buffer, addPassword);
         buffer.append('/');
@@ -75,7 +74,7 @@ public class SmbFileName
      * put domain before username if both are set
      */
     @Override
-    protected void appendCredentials(StringBuffer buffer, boolean addPassword)
+    protected void appendCredentials(StringBuilder buffer, boolean addPassword)
     {
         if (getDomain() != null && getDomain().length() != 0 &&
             getUserName() != null && getUserName().length() != 0)
@@ -114,7 +113,7 @@ public class SmbFileName
             return uriWithoutAuth;
         }
 
-        StringBuffer sb = new StringBuffer(120);
+        StringBuilder sb = new StringBuilder(120);
         sb.append(getScheme());
         sb.append("://");
         sb.append(getHostName());

Modified: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileNameParser.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileNameParser.java?rev=1035190&r1=1035189&r2=1035190&view=diff
==============================================================================
--- commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileNameParser.java
(original)
+++ commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileNameParser.java
Mon Nov 15 08:58:37 2010
@@ -44,7 +44,7 @@ public class SmbFileNameParser extends U
     @Override
     public FileName parseUri(final VfsComponentContext context, FileName base, final String
filename) throws FileSystemException
     {
-        final StringBuffer name = new StringBuffer();
+        final StringBuilder name = new StringBuilder();
 
         // Extract the scheme and authority parts
         final Authority auth = extractToPath(filename, name);



Mime
View raw message