Permalink
Browse files

Add fromFilePath

  • Loading branch information...
making committed Jan 11, 2018
1 parent dc0f143 commit 3e004060598ced547832975f9ff625ada73e6066
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/main/java/am/ik/blog/entry/EntryId.java
@@ -1,9 +1,9 @@
package am.ik.blog.entry;
import java.io.Serializable;
import java.nio.file.Path;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@@ -28,4 +28,8 @@ public static EntryId fromFileName(String fileName) {
String entryId = fileName.replace(".md", "");
return new EntryId(Long.valueOf(entryId));
}
public static EntryId fromFilePath(Path filePath) {
return fromFileName(filePath.getFileName().toString());
}
}

0 comments on commit 3e00406

Please sign in to comment.