-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from TAMULib/tamu-june-dame-sprint-b03507-mime-…
…types allow/disallow by mime type
- Loading branch information
Showing
63 changed files
with
726 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/edu/tamu/iiif/controller/ManifestBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package edu.tamu.iiif.controller; | ||
|
||
import java.util.List; | ||
|
||
import javax.servlet.http.HttpServletResponse; | ||
|
||
public class ManifestBuilder { | ||
|
||
private final HttpServletResponse response; | ||
|
||
private final ManifestRequest request; | ||
|
||
public ManifestBuilder(HttpServletResponse response, ManifestRequest request) { | ||
this.response = response; | ||
this.request = request; | ||
} | ||
|
||
public HttpServletResponse getResponse() { | ||
return response; | ||
} | ||
|
||
public ManifestRequest getRequest() { | ||
return request; | ||
} | ||
|
||
public static ManifestBuilder of(HttpServletResponse response, String path, boolean update, List<String> allowed, List<String> disallowed) { | ||
return new ManifestBuilder(response, ManifestRequest.of(path, update, allowed, disallowed)); | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
src/main/java/edu/tamu/iiif/controller/ManifestRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package edu.tamu.iiif.controller; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class ManifestRequest { | ||
|
||
private final String context; | ||
|
||
private final boolean update; | ||
|
||
private final List<String> allowed; | ||
|
||
private final List<String> disallowed; | ||
|
||
public ManifestRequest(String context, boolean update, List<String> allowed, List<String> disallowed) { | ||
this.context = context; | ||
this.update = update; | ||
this.allowed = allowed; | ||
this.disallowed = disallowed; | ||
} | ||
|
||
public String getContext() { | ||
return context; | ||
} | ||
|
||
public boolean isUpdate() { | ||
return update; | ||
} | ||
|
||
public String getAllowed() { | ||
return String.join(",", allowed); | ||
} | ||
|
||
public String getDisallowed() { | ||
return String.join(",", disallowed); | ||
} | ||
|
||
public static ManifestRequest of(String path, boolean update, List<String> allowed, List<String> disallowed) { | ||
return new ManifestRequest(path, update, allowed, disallowed); | ||
} | ||
|
||
public static ManifestRequest of(String path, boolean update) { | ||
return new ManifestRequest(path, update, new ArrayList<String>(), new ArrayList<String>()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.