Response getDirectoryOrFileContents()

in taverna-server-webapp/src/main/java/org/apache/taverna/server/master/rest/TavernaServerDirectoryREST.java [116:206]


	Response getDirectoryOrFileContents(
			@Nonnull @PathParam("path") List<PathSegment> path,
			@Nonnull @Context UriInfo ui, @Nonnull @Context HttpHeaders headers)
			throws NoDirectoryEntryException, FilesystemAccessException,
			NegotiationFailedException;

	/**
	 * Creates a directory in the filesystem beneath the working directory of
	 * the workflow run, or creates or updates a file's contents, where that
	 * file is in or below the working directory of a workflow run.
	 * 
	 * @param parent
	 *            The directory to create the directory in.
	 * @param operation
	 *            What to call the directory to create.
	 * @param ui
	 *            About how this method was called.
	 * @return An HTTP response indicating where the directory was actually made
	 *         or what file was created/updated.
	 * @throws NoDirectoryEntryException
	 *             If the name of the containing directory can't be looked up.
	 * @throws NoUpdateException
	 *             If the user is not permitted to update the run.
	 * @throws FilesystemAccessException
	 *             If something went wrong during the filesystem operation.
	 */
	@POST
	@Path("{path:.*}")
	@Description("Creates a directory in the filesystem beneath the working "
			+ "directory of the workflow run, or creates or updates a file's "
			+ "contents, where that file is in or below the working directory "
			+ "of a workflow run.")
	@Nonnull
	Response makeDirectoryOrUpdateFile(
			@Nonnull @PathParam("path") List<PathSegment> parent,
			@Nonnull MakeOrUpdateDirEntry operation,
			@Nonnull @Context UriInfo ui) throws NoUpdateException,
			FilesystemAccessException, NoDirectoryEntryException;

	/**
	 * Creates or updates a file in a particular location beneath the working
	 * directory of the workflow run.
	 * 
	 * @param file
	 *            The path to the file to create or update.
	 * @param referenceList
	 *            Location to get the file's contents from. Must be
	 *            <i>publicly</i> readable.
	 * @param ui
	 *            About how this method was called.
	 * @return An HTTP response indicating what file was created/updated.
	 * @throws NoDirectoryEntryException
	 *             If the name of the containing directory can't be looked up.
	 * @throws NoUpdateException
	 *             If the user is not permitted to update the run.
	 * @throws FilesystemAccessException
	 *             If something went wrong during the filesystem operation.
	 */
	@POST
	@Path("{path:(.*)}")
	@Consumes(URI_LIST)
	@Description("Creates or updates a file in a particular location beneath the "
			+ "working directory of the workflow run with the contents of a "
			+ "publicly readable URL.")
	@Nonnull
	Response setFileContentsFromURL(@PathParam("path") List<PathSegment> file,
			List<URI> referenceList, @Context UriInfo ui)
			throws NoDirectoryEntryException, NoUpdateException,
			FilesystemAccessException;

    /**
	 * Creates or updates a file in a particular location beneath the working
	 * directory of the workflow run.
	 * 
	 * @param file
	 *            The path to the file to create or update.
	 * @param contents
	 *            Stream of bytes to set the file's contents to.
	 * @param ui
	 *            About how this method was called.
	 * @return An HTTP response indicating what file was created/updated.
	 * @throws NoDirectoryEntryException
	 *             If the name of the containing directory can't be looked up.
	 * @throws NoUpdateException
	 *             If the user is not permitted to update the run.
	 * @throws FilesystemAccessException
	 *             If something went wrong during the filesystem operation.
	 */
	@PUT
	@Path("{path:(.*)}")
	@Consumes({ BYTES, WILDCARD })