public static void main(String[] args) throws IOException {

    if (testConfig == null) {
      testConfig = new KalturaTestConfig();
    }

    try {

      list();
      multiRequest();
      KalturaMediaEntry entry = addEmptyEntry();
      uploadMediaFileByChunkAndAttachToEmptyEntry(entry);
      testIfEntryIsReadyForPublish(entry);
      // cleanup the sample by deleting the entry:
      deleteEntry(entry);
      System.out.println("Sample code finished successfully.");

    } catch (KalturaApiException e) {
      System.out.println("Example failed.");
      e.printStackTrace();
    }
  }
예제 #2
0
파일: Main.java 프로젝트: DBezemer/server
 @Override
 protected Void doInBackground(Void... params) {
   // Test for connection
   try {
     if (Utils.checkInternetConnection(getApplicationContext())) {
       /** Getting list of all categories */
       publishProgress(States.LOADING_DATA);
       listCategory = Category.listAllCategories(TAG, 1, 500);
     }
   } catch (KalturaApiException e) {
     e.printStackTrace();
     message = e.getMessage();
     Log.w(TAG, message);
     publishProgress(States.ERR);
   } catch (Exception e) {
     e.printStackTrace();
     message = e.getMessage();
     Log.w(TAG, message);
     publishProgress(States.NO_CONNECTION);
   }
   return null;
 }