Search in sources :

Example 6 with CloudFile

use of com.microsoft.azure.storage.file.CloudFile in project zeppelin by apache.

the class AzureNotebookRepo method save.

@Override
public void save(Note note, AuthenticationInfo subject) throws IOException {
    try {
        CloudFile noteFile = rootDir.getFileReference(buildNoteFileName(note));
        noteFile.getParent().createIfNotExists();
        noteFile.uploadText(note.toJson());
    } catch (URISyntaxException | StorageException e) {
        String msg = String.format("Error saving notebook %s to Azure storage", buildNoteFileName(note));
        LOGGER.error(msg, e);
        throw new IOException(msg, e);
    }
}
Also used : CloudFile(com.microsoft.azure.storage.file.CloudFile) URISyntaxException(java.net.URISyntaxException) IOException(java.io.IOException) StorageException(com.microsoft.azure.storage.StorageException)

Aggregations

CloudFile (com.microsoft.azure.storage.file.CloudFile)6 IOException (java.io.IOException)5 StorageException (com.microsoft.azure.storage.StorageException)4 URISyntaxException (java.net.URISyntaxException)4 CloudFileDirectory (com.microsoft.azure.storage.file.CloudFileDirectory)3 ListFileItem (com.microsoft.azure.storage.file.ListFileItem)2 InputStream (java.io.InputStream)2 Gson (com.google.gson.Gson)1 GsonBuilder (com.google.gson.GsonBuilder)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 Note (org.apache.zeppelin.notebook.Note)1 NoteInfo (org.apache.zeppelin.notebook.NoteInfo)1 NotebookImportDeserializer (org.apache.zeppelin.notebook.NotebookImportDeserializer)1 Paragraph (org.apache.zeppelin.notebook.Paragraph)1