merge from master
[nikiroo-utils.git] / library / WebLibraryUrls.java
index 41f1c82feb17c2312ddc3868f5fd9176f3886c59..5ec669fea4d313dda921209a4d693c5f4ee5d16a 100644 (file)
@@ -38,6 +38,9 @@ class WebLibraryUrls {
        static private final String IMPRT_URL_PROGRESS = IMPRT_URL_BASE + "{luid}";
        static public final String IMPRT_URL_IMPORT = IMPRT_URL_BASE + "import";
 
+       static private final String DELETE_URL_BASE = "/delete/";
+       static private final String DELETE_URL_STORY = DELETE_URL_BASE + "{luid}";
+
        // GET/SET ("luid" param -> set cover to the cover of this story -- not ok
        // for /cover/story/)
        static private final String COVER_URL_BASE = "/cover/";
@@ -101,7 +104,8 @@ class WebLibraryUrls {
        static public boolean isSupportedUrl(String url) {
                return INDEX_URL.equals(url) || VERSION_URL.equals(url)
                                || LOGOUT_URL.equals(url) || isViewUrl(url) || isStoryUrl(url)
-                               || isListUrl(url) || isCoverUrl(url) || isImprtUrl(url);
+                               || isListUrl(url) || isCoverUrl(url) || isImprtUrl(url)
+                               || isDeleteUrl(url);
        }
 
        static public String getCoverUrlStory(String luid) {
@@ -119,6 +123,11 @@ class WebLibraryUrls {
                                .replace("{author}", author);
        }
 
+       static public String getDeleteUrlStory(String luid) {
+               return DELETE_URL_STORY //
+                               .replace("{luid}", luid);
+       }
+
        static public boolean isViewUrl(String url) {
                return url != null && url.startsWith(VIEWER_URL_BASE);
        }
@@ -138,4 +147,8 @@ class WebLibraryUrls {
        static public boolean isImprtUrl(String url) {
                return url != null && url.startsWith(IMPRT_URL_BASE);
        }
+
+       static public boolean isDeleteUrl(String url) {
+               return url != null && url.startsWith(DELETE_URL_BASE);
+       }
 }