archiva-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Lamy <ol...@apache.org>
Subject Re: svn commit: r1234639 - /archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultCommonServices.java
Date Sun, 22 Jan 2012 23:55:31 GMT
Thanks Brett !

I tried animal sniffer to prevent that but have a weird issue and
didn't get time to investigate.

see https://gist.github.com/1659445

2012/1/22  <brett@apache.org>:
> Author: brett
> Date: Sun Jan 22 22:57:02 2012
> New Revision: 1234639
>
> URL: http://svn.apache.org/viewvc?rev=1234639&view=rev
> Log:
> remove JDK 6 specific API
>
> Modified:
>    archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultCommonServices.java
>
> Modified: archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultCommonServices.java
> URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultCommonServices.java?rev=1234639&r1=1234638&r2=1234639&view=diff
> ==============================================================================
> --- archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultCommonServices.java
(original)
> +++ archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultCommonServices.java
Sun Jan 22 22:57:02 2012
> @@ -22,6 +22,7 @@ import org.apache.archiva.rest.api.servi
>  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.Se
>
>  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 );
>         }
>     }
>  }
>
>



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

Mime
View raw message