Merge branch 'master' into subtree
[nikiroo-utils.git] / library / BasicLibrary.java
index f6024eef85025eefc0f0df1ada0b02fd2c2b254a..f77d0edcef5ae64b186942be2a6048fa7eca7745 100644 (file)
@@ -475,6 +475,8 @@ abstract public class BasicLibrary {
 
        /**
         * Retrieve a specific {@link Story}.
+        * <p>
+        * Note that it will update both the cover and the resume in <tt>meta</tt>.
         * 
         * @param luid
         *            the Library UID of the story
@@ -513,6 +515,8 @@ abstract public class BasicLibrary {
 
        /**
         * Retrieve a specific {@link Story}.
+        * <p>
+        * Note that it will update both the cover and the resume in <tt>meta</tt>.
         * 
         * @param luid
         *            the LUID of the story
@@ -595,6 +599,28 @@ abstract public class BasicLibrary {
         *             in case of I/O error
         */
        public MetaData imprt(URL url, Progress pg) throws IOException {
+               return imprt(url, null, pg);
+       }
+
+       /**
+        * Import the {@link Story} at the given {@link URL} into the
+        * {@link BasicLibrary}.
+        * 
+        * @param url
+        *            the {@link URL} to import
+        * @param luid
+        *            the LUID to use
+        * @param pg
+        *            the optional progress reporter
+        * 
+        * @return the imported Story {@link MetaData}
+        * 
+        * @throws UnknownHostException
+        *             if the host is not supported
+        * @throws IOException
+        *             in case of I/O error
+        */
+       MetaData imprt(URL url, String luid, Progress pg) throws IOException {
                if (pg == null)
                        pg = new Progress();
 
@@ -609,7 +635,7 @@ abstract public class BasicLibrary {
                        throw new UnknownHostException("" + url);
                }
 
-               Story story = save(support.process(pgProcess), pgSave);
+               Story story = save(support.process(pgProcess), luid, pgSave);
                pg.done();
 
                return story.getMeta();