]> source.dussan.org Git - archiva.git/commitdiff
remove JDK 6 specific API
authorBrett Porter <brett@apache.org>
Sun, 22 Jan 2012 22:57:02 +0000 (22:57 +0000)
committerBrett Porter <brett@apache.org>
Sun, 22 Jan 2012 22:57:02 +0000 (22:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1234639 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultCommonServices.java

index 2be8870213c2715f3358db5c8cf0379f733a6532..1a21588ddb5dc684a79a2be374b2097de81baabc 100644 (file)
@@ -22,6 +22,7 @@ import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.archiva.rest.api.services.CommonServices;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringUtils;
+import org.codehaus.plexus.util.StringInputStream;
 import org.codehaus.redback.rest.api.services.RedbackServiceException;
 import org.codehaus.redback.rest.api.services.UtilServices;
 import org.slf4j.Logger;
@@ -30,6 +31,7 @@ import org.springframework.stereotype.Service;
 
 import javax.inject.Inject;
 import javax.ws.rs.core.Response;
+import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.StringReader;
@@ -145,12 +147,11 @@ public class DefaultCommonServices
     private void loadFromString( String propsStr, Properties properties )
         throws ArchivaRestServiceException
     {
-
-        StringReader stringReader = null;
+        InputStream inputStream = null;
         try
         {
-            stringReader = new StringReader( propsStr );
-            properties.load( stringReader );
+            inputStream = new ByteArrayInputStream( propsStr.getBytes() );
+            properties.load( inputStream );
         }
         catch ( IOException e )
         {
@@ -159,7 +160,7 @@ public class DefaultCommonServices
         }
         finally
         {
-            IOUtils.closeQuietly( stringReader );
+            IOUtils.closeQuietly( inputStream );
         }
     }
 }