congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
RemoveRemoteShareOperation
Code IndexAdd Tabnine to your IDE (free)

How to use
RemoveRemoteShareOperation
in
com.owncloud.android.lib.resources.shares

Best Java code snippets using com.owncloud.android.lib.resources.shares.RemoveRemoteShareOperation (Showing top 2 results out of 315)

origin: owncloud/android-library

@Override
protected RemoteOperationResult run(OwnCloudClient client) {
  RemoteOperationResult result;
  try {
    Uri requestUri = client.getBaseUri();
    Uri.Builder uriBuilder = requestUri.buildUpon();
    uriBuilder.appendEncodedPath(ShareUtils.SHARING_API_PATH);
    uriBuilder.appendEncodedPath(String.valueOf(mRemoteShareId));
    DeleteMethod deleteMethod = new DeleteMethod(
        new URL(uriBuilder.build().toString())
    );
    deleteMethod.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE);
    int status = client.executeHttpMethod(deleteMethod);
    if (isSuccess(status)) {
      // Parse xml response and obtain the list of shares
      ShareToRemoteOperationResultParser parser = new ShareToRemoteOperationResultParser(
          new ShareXMLParser()
      );
      result = parser.parse(deleteMethod.getResponseBodyAsString());
      Log_OC.d(TAG, "Unshare " + mRemoteShareId + ": " + result.getLogMessage());
    } else {
      result = new RemoteOperationResult<>(deleteMethod);
    }
  } catch (Exception e) {
    result = new RemoteOperationResult<>(e);
    Log_OC.e(TAG, "Unshare Link Exception " + result.getLogMessage(), e);
  }
  return result;
}
origin: nextcloud/android-library

@Override
protected RemoteOperationResult run(OwnCloudClient client) {
  RemoteOperationResult result = null;
  int status = -1;
  DeleteMethod delete = null;
  try {
    String id = "/" + String.valueOf(mRemoteShareId);
    delete = new DeleteMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH + id);
    delete.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE);
    status = client.executeMethod(delete);
    if (isSuccess(status)) {
      String response = delete.getResponseBodyAsString();
      // Parse xml response and obtain the list of shares
      ShareToRemoteOperationResultParser parser = new ShareToRemoteOperationResultParser(
        new ShareXMLParser()
      );
      result = parser.parse(response);
      Log_OC.d(TAG, "Unshare " + id + ": " + result.getLogMessage());
    } else {
      result = new RemoteOperationResult(false, delete);
    }
  } catch (Exception e) {
    result = new RemoteOperationResult(e);
    Log_OC.e(TAG, "Unshare Link Exception " + result.getLogMessage(), e);
  } finally {
    if (delete != null)
      delete.releaseConnection();
  }
  return result;
}
com.owncloud.android.lib.resources.sharesRemoveRemoteShareOperation

Javadoc

Remove a share

Most used methods

  • isSuccess

Popular in Java

  • Start an intent from android
  • requestLocationUpdates (LocationManager)
  • setContentView (Activity)
  • setRequestProperty (URLConnection)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now