Skip to content

Commit

Permalink
ensure path is set on read endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ssalinas committed May 9, 2017
1 parent 7d7add7 commit 56fcfe2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.hubspot.singularity.resources;

import static com.hubspot.singularity.WebExceptions.badRequest;
import static com.hubspot.singularity.WebExceptions.checkBadRequest;
import static com.hubspot.singularity.WebExceptions.checkNotFound;
import static com.hubspot.singularity.WebExceptions.notFound;

Expand Down Expand Up @@ -137,6 +138,8 @@ public MesosFileChunkObject read(@ApiParam("The task ID of the sandbox to read f

final SingularityTaskHistory history = checkHistory(taskId);

checkBadRequest(!Strings.isNullOrEmpty(path), "Must specify 'path'");

final String slaveHostname = history.getTask().getOffer().getHostname();
final String fullPath = new File(history.getDirectory().get(), path).toString();

Expand Down

0 comments on commit 56fcfe2

Please sign in to comment.