public void cleanup() {
        for (int i=0; i < getNumFilesWritten(); i++) {
            File f = getFile(i);
            if (f.exists()) {
                if (!f.delete()) {
                    LogFactory.getLog(getClass()).debug(
                            "Ignoring failure to delete file " + f);
                }
            }
        }
    }
Blocks the running thread if running out of disk space.

@throws AbortedException
            if the running thread is interrupted while acquiring a
            semaphore
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/MultiFileOutputStream.java