Note Java: Password Protected OneNote Online File not Recognized

OnlineExported.zip (49.8 KB)

Aspose Team,
We use the Aspose Note java package to get the text and metadata of Microsoft OneNote files and found out that password protected OneNote files exported from the Web version of OneNote are not Recognized.

Following is the sample code that reproduces the problem and attached is the Notebook zip file exported from the Web version of OneNote.

There are two .one files. The file without protection is recognized as “OneNote Online”, and that with protection throws the following exception:
class com.aspose.note.system.exceptions.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
com.aspose.note.system.collections.BitArray.get(Unknown Source)

The operating system is Ubuntu 18.04. Java version is 1.8. Aspose PDF java package is 21.7.

import com.aspose.note.Document;
import com.aspose.note.FileFormat;

public class ReadOntNote {

public static void main(String[] args) {
    try {
        String inputFile = "path_to_the_one_file";
        Document onedoc= new Document(inputFile);

        System.out.println("File info:");
        switch (onedoc.getFileFormat())
        {
            case FileFormat.OneNote2010:
                System.out.println("OneNote 2010");
                break;
            case FileFormat.OneNoteOnline:
                System.out.println("OneNote Online");
                break;
            default:
                System.out.println("Unknown");
        }
    }
    catch(Exception ex) {
        ex.printStackTrace();
    }
}

}

@xyang,
We have observed this issue and logged it in our database for further investigation. You will be notified here once any update is ready for sharing.

This issue is logged as:
NOTEJAVA-987 - Password Protected OneNote Online File not Recognized