/* package */ ContentState getContentStateForTransfer(final String filePath) {
    if (!transferHelper.isTransferring(filePath)) {
      return ContentState.REMOTE;
    }

    boolean localContentAvailable = localContentCache.contains(filePath);

    if (transferHelper.isTransferWaiting(filePath)) {
      if (localContentAvailable) {
        return ContentState.CACHED_NEW_VERSION_TRANSFER_WAITING;
      }
      return ContentState.TRANSFER_WAITING;
    }
    if (localContentAvailable) {
      return ContentState.CACHED_TRANSFERRING_NEW_VERSION;
    }
    return ContentState.TRANSFERRING;
  }
Exemplo n.º 2
0
  void set(TransferDb database, Traceable t, String q) {

    super.set(database, t, q);

    // set the Dateformat for our connection
    String dateFormatStmnt = "ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'";

    System.out.println("dateFormatStmnt: " + dateFormatStmnt);

    try {
      tracer.trace("Executing " + dateFormatStmnt);
      database.execute(dateFormatStmnt);
    } catch (Exception e) {
      tracer.trace("Ignoring error " + e.getMessage());
      System.out.println("Ignoring error " + e.getMessage());
    }
  }
 /**
  * This must should be called once the content manager is no longer needed. No methods should be
  * called on the ContentManager once this method has been called.
  */
 public synchronized void destroy() {
   transferHelper.destroy();
 }
 /**
  * Set the progress listener for a file managed by the content manager.
  *
  * @param filePath the relative path and file name.
  * @param listener the listening handler.
  */
 public void setProgressListener(final String filePath, final ContentProgressListener listener) {
   transferHelper.setProgressListener(filePath, listener);
 }
 /** Clears all progress listeners associated with this content manager. */
 public void clearProgressListeners() {
   transferHelper.clearProgressListeners();
 }