Skip to content

Commit

Permalink
Fix: PUT support sonatype-nexus-community#114
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan S. Fisher committed May 27, 2019
1 parent 1500c11 commit 3c412fe
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Nexus APT plugin.
*
*
* Copyright (c) 2016-Present Michael Poindexter.
*
*
* This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
* which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
*
Expand All @@ -14,6 +14,7 @@
import static org.sonatype.nexus.repository.http.HttpMethods.GET;
import static org.sonatype.nexus.repository.http.HttpMethods.HEAD;
import static org.sonatype.nexus.repository.http.HttpMethods.POST;
import static org.sonatype.nexus.repository.http.HttpMethods.PUT;

import java.io.IOException;

Expand Down Expand Up @@ -55,7 +56,9 @@ public Response handle(Context context) throws Exception {
hostedFacet.rebuildIndexes();
return HttpResponses.ok();
}
else if (path.equals("")) {
}
case PUT: {
if (path.equals("")) {
hostedFacet.ingestAsset(context.getRequest().getPayload());
return HttpResponses.created();
}
Expand All @@ -65,7 +68,7 @@ else if (path.equals("")) {
}

default:
return HttpResponses.methodNotAllowed(method, GET, HEAD, POST);
return HttpResponses.methodNotAllowed(method, GET, HEAD, POST, PUT);
}
}

Expand Down

0 comments on commit 3c412fe

Please sign in to comment.