try {
// client.setDebug(1);
client.startSession("localhost", portNumber);
client.setCredentials(new Credentials("guest", "guest"));
pm.setPath( resourceName );
pm.sendData( new StringBufferInputStream(fileContent));
client.executeMethod( pm );
System.out.println( "PUT to " + resourceName + " : " + pm.getStatusCode() +
" " + pm.getStatusText() +
" (time: " + (System.currentTimeMillis() - startTime) + " ms)" );