Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
Version 602. Eliminated unnecessary title loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
n-y-z-o committed Sep 5, 2020
1 parent d52a530 commit 1dcaabe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/co/nyzo/verifier/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class Version {

private static final int version = 601;
private static final int version = 602;

public static int getVersion() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class DocumentationEndpoint implements EndpointResponseProvider {
public DocumentationEndpoint(String path, File file) {
this.path = processPath(path);
this.file = file.isDirectory() ? new File(file, "index.html") : file;
this.title = findTitle(this.file);
this.type = determineType(this.file);
this.title = findTitle(this.file, this.type);
this.children = new ArrayList<>();
}

Expand Down Expand Up @@ -107,9 +107,9 @@ private static String processPath(String path) {
return reassembled.toString();
}

private static String findTitle(File file) {
private static String findTitle(File file, DocumentationEndpointType type) {
String title = null;
if (!file.isDirectory()) {
if (!file.isDirectory() && type == DocumentationEndpointType.Html) {
try {
String fileContents = new String(Files.readAllBytes(Paths.get(file.getAbsolutePath())),
StandardCharsets.UTF_8);
Expand Down

0 comments on commit 1dcaabe

Please sign in to comment.