code: public static <T extends File> T createFile(final SecurityContext securityContext, final InputStream fileStream, final Class<T> fileType, final PropertyMap props)
  		throws FrameworkException, IOException {
  
  		T newFile = (T) StructrApp.getInstance(securityContext).create(fileType, props);
  
  		setFileData(newFile, fileStream, props.get(StructrApp.key(File.class, "contentType")));
  
  		// schedule indexing
  		newFile.notifyUploadCompletion();
  
  		return newFile;
  	}
docs: Create a new file node from the given input stream and sets the parentFolder
  
  @param <T>
  @param securityContext
  @param fileStream
  @param fileType defaults to File.class if null
  @param props
  @return file
  @throws FrameworkException
  @throws IOException