code: public static <T extends File> T createFile(final SecurityContext securityContext, final byte[] fileData, final String contentType, final Class<T> t, final String name, final boolean updateMetadata)
  		throws FrameworkException, IOException {
  
  		final PropertyMap props = new PropertyMap();
  
  		props.put(AbstractNode.name, name);
  
  		T newFile = (T) StructrApp.getInstance(securityContext).create(t, props);
  
  		setFileData(newFile, fileData, contentType, updateMetadata);
  
  		if (updateMetadata) {
  			newFile.notifyUploadCompletion();
  		}
  
  		return newFile;
  	}
docs: Create a new file node from the given byte array
  
  @param <T>
  @param securityContext
  @param fileData
  @param contentType if null, try to auto-detect content type
  @param t
  @param name
  @param updateMetadata
  @return file
  @throws FrameworkException
  @throws IOException