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;
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;
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 )
{
}
finally
{
- IOUtils.closeQuietly( stringReader );
+ IOUtils.closeQuietly( inputStream );
}
}
}