File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
AnkiDroid/src/main/java/com/ichi2/anki/servicelayer
libanki/src/main/java/com/ichi2/anki/libanki Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ import com.ichi2.anki.observability.undoableOp
4242import org.json.JSONException
4343import timber.log.Timber
4444import java.io.File
45+ import java.io.IOException
4546
4647object NoteService {
4748 /* *
@@ -123,6 +124,9 @@ object NoteService {
123124 * Considering the field is new, if it has media handle it
124125 *
125126 * @param field
127+ *
128+ * @throws IOException
129+ * @throws OutOfMemoryError if the file could not be copied to a contiguous block of memory (or is >= 2GB)
126130 */
127131 fun importMediaToDirectory (
128132 col : Collection ,
Original file line number Diff line number Diff line change @@ -61,6 +61,10 @@ open class Media(
6161 ***********************************************************
6262 */
6363
64+ /* *
65+ * @throws EmptyMediaException if [oFile] is empty or null
66+ * @throws OutOfMemoryError if the file could not be copied to a contiguous block of memory (or is >= 2GB)
67+ */
6468 fun addFile (oFile : File ? ): String {
6569 if (oFile == null || oFile.length() == 0L ) {
6670 throw EmptyMediaException ()
Original file line number Diff line number Diff line change 1515 */
1616package com.ichi2.anki.libanki.exception
1717
18- // Empty media files cannot be added to AnkiWeb
18+ /* *
19+ * Exception raised when attempting to add an empty, or non-existing media file
20+ *
21+ * Empty media files cannot be added to AnkiWeb
22+ */
1923class EmptyMediaException : Exception ()
You can’t perform that action at this time.
0 commit comments