
br.com.objectos.way.gdrive.DriveExecError Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2014 Objectos, Fábrica de Software LTDA.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package br.com.objectos.way.gdrive;
import java.io.InputStream;
import java.util.Iterator;
import com.google.api.services.drive.model.Change;
import com.google.api.services.drive.model.File;
/**
* @author [email protected] (Marcio Endo)
*/
class DriveExecError implements DriveExec {
private final Exception cause;
public DriveExecError(Exception cause) {
this.cause = cause;
}
@Override
public File directoryOf(String id) {
throw propagate();
}
@Override
public Iterator iterateFilesOf(File file) {
throw propagate();
}
@Override
public Iterator iterateFilesOf(String id) {
throw propagate();
}
@Override
public File getFile(String fileId) {
throw propagate();
}
@Override
public File mkdir(File file, String name) {
throw propagate();
}
@Override
public File mkdir(String id, String name) {
throw propagate();
}
@Override
public File write(File file, From from, String title, MimeType mimeType) {
throw propagate();
}
@Override
public File write(String id, From from, String title, MimeType mimeType) {
throw propagate();
}
@Override
public InputStream downloadUrl(String url) {
throw propagate();
}
@Override
public Iterator iterateChangesOf(File file, ChangeId changeId) {
throw propagate();
}
@Override
public Iterator iterateChangesOf(String id, ChangeId changeId) {
throw propagate();
}
@Override
public File trash(String id) {
throw propagate();
}
@Override
public File untrash(String id) {
throw propagate();
}
private GDriveException propagate() {
return new GDriveException(
"Could not access Google Drive. Please check your credentials or if you have the required permissions.",
cause);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy