int k = -1;
while (in!=null && (k = in.read(buffer)) != -1)
out.write(buffer, 0, k);
out.close();
} finally {
out.abort();
}
resource.getMount().resourceUpload(resource, transaction, null);
} catch (Exception e) {
resource.getMount().resourceUpload(resource, transaction, e);
IOException ioe = new IOException(e.getMessage());