code: public File createFile(String relativePath, InputStream sourceData) throws IOException {
          final File tempFile = getFile(relativePath);
          boolean ok = false;
          try {
              final FileOutputStream fos = new FileOutputStream(tempFile);
              try {
                  VFSUtils.copyStream(sourceData, fos);
                  fos.close();
                  sourceData.close();
                  ok = true;
                  return tempFile;
              } finally {
                  VFSUtils.safeClose(fos);
              }
          } finally {
              VFSUtils.safeClose(sourceData);
              if (!ok) {
                  tempFile.delete();
              }
          }
      }
docs: Create a file within this temporary directory, prepopulating the file from the given input stream.
  
  @param relativePath the relative path name
  @param sourceData   the source input stream to use
  @return the file
  @throws IOException if the directory was closed at the time of this invocation or an error occurs