AnsweredAssumed Answered

Write a File in the content in SaaS with a B2

Question asked by juan.mendez on Nov 23, 2018

Hi, we are having issues in SaaS creating a text file in the content system from a B2, this B2 works perfectly in Amazon EMC and in the Vagrant Developers machine, but in the SaaS we are getting exeptions like:

 

Error java.lang.ClassCastException: com.xythos.common.CloudStorageLocationImpl cannot be cast to com.xythos.common.api.ExternalStorageLocation

at com.kamila.bb.util.ContentSystemUtil.getPhysicalPath(ContentSystemUtil.java:81)

at com.kamila.bb.util.ContentSystemUtil.writeReportToContentSystem(ContentSystemUtil.java:47)

at com.kamila.bb.service.CsvGradeExtractManager.generateGradeExtractFile(CsvGradeExtractManager.java:200)

at com.kamila.bb.service.BBGradebookExtractService.executeGradeExtractProcess(BBGradebookExtractService.java:276)

at com.kamila.bb.gradeExtract.scheduler.GradeExtractFireGenerateJob.execute(GradeExtractFireGenerateJob.java:85)

at org.quartz.core.JobRunShell.run(JobRunShell.java:202)

at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)

 

Here is the entire function:

 

  private static String getPhysicalPath(FileSystemFile entry, Context context)

    throws XythosException

  {

    String from = "";

    if (entry != null)

    {

      String storageFilename = entry.getFileVersionStorageFileName();

      StorageLocation storageLocation = entry.getFileVersionStorageLocation();

      ExternalStorageLocation store = (ExternalStorageLocation)storageLocation;

      if ((store.getUnixStorageLocation() != null) && (store.getUnixStorageLocation().length() != 0))

      {

        from = store.getUnixStorageLocation() + storageFilename;

      }

      else

      {

        storageFilename = storageFilename.replace("/", "\\");

        from = store.getWindowsStorageLocation() + storageFilename;

      }

    }

    return from;

  }

 

Does  any one knows or can share a part of the code that creates a file in SaaS content system from a B2?.

Outcomes