remove JDK 6 specific API

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1234639 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2012-01-22 22:57:02 +00:00
parent 2f18ed3e94
commit 0a034cdec5
1 changed files with 6 additions and 5 deletions
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services

View File

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