forked from xwiki-contrib/application-googleapps
-
Notifications
You must be signed in to change notification settings - Fork 7
Java ize2 #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
polx
wants to merge
17
commits into
xwikisas:master
Choose a base branch
from
polx:java-ize2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Java ize2 #39
Changes from 6 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
861f2b8
Style comments on the PR.
polx 80ac30e
Forgotten to address this request. Thanks for the reminder.
polx 38eeefa
Readability comments from @acotiuga and @mflorea. Thanks.
polx a5a6938
Introducing GoogleAppsException and thus removing the API-level depen…
polx 0f0139b
Changing package to com.xwiki.googleapps.
polx cc89974
Moved a few components to the internal package (and making their role…
polx bda0e8e
Code-style automatic adjustments with correct (XWiki) style.
polx 782b36d
Unstability for complete classes.
polx 70368b2
Do use the GoogleAppsListener!
polx 48c0b31
Indenting.
polx 4e44d34
Indenting and normalising spaces.
polx 1927504
Refactoring methods to fetch drive-documents to get rid of gdata and …
polx 8bc27e8
Refactoring for complexity and syntax style.
polx c823813
Comments' fixes: mostly cleaned up code a bit (see https://github.co…
polx 643fb3c
Comments' fixes: do not fix version in the POM and do not make half b…
polx d810949
Removing complex constructors in favor of internal components.
polx 0952fbd
The redirect URL is not OAuth anymore.
polx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
api/src/main/java/com/xwiki/googleapps/DriveDocMetadata.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| /* | ||
| * See the NOTICE file distributed with this work for additional | ||
| * information regarding copyright ownership. | ||
| * | ||
| * This is free software; you can redistribute it and/or modify it | ||
| * under the terms of the GNU Lesser General Public License as | ||
| * published by the Free Software Foundation; either version 2.1 of | ||
| * the License, or (at your option) any later version. | ||
| * | ||
| * This software is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public | ||
| * License along with this software; if not, write to the Free | ||
| * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
| */ | ||
| package com.xwiki.googleapps; | ||
|
|
||
| import org.xwiki.stability.Unstable; | ||
|
|
||
| /** | ||
| * Simple pojo for metadata about a doc in Google Drive. | ||
| * | ||
| * @version $Id$ | ||
| * @since 3.0 | ||
| */ | ||
| @Unstable | ||
| public class DriveDocMetadata | ||
| { | ||
| /** | ||
| * Google's internal id to find the document again. | ||
| */ | ||
| public String id; | ||
|
|
||
| /** | ||
| * URL to direct the user to for editing. | ||
| */ | ||
| public String editLink; | ||
|
|
||
| /** | ||
| * URL to pull from in order to fetch the document. | ||
| */ | ||
| public String exportLink; | ||
| } |
92 changes: 92 additions & 0 deletions
92
api/src/main/java/com/xwiki/googleapps/GoogleAppsException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| /* | ||
| * See the NOTICE file distributed with this work for additional | ||
| * information regarding copyright ownership. | ||
| * | ||
| * This is free software; you can redistribute it and/or modify it | ||
| * under the terms of the GNU Lesser General Public License as | ||
| * published by the Free Software Foundation; either version 2.1 of | ||
| * the License, or (at your option) any later version. | ||
| * | ||
| * This software is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public | ||
| * License along with this software; if not, write to the Free | ||
| * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
| */ | ||
| package com.xwiki.googleapps; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| import org.xwiki.stability.Unstable; | ||
|
|
||
| import com.xpn.xwiki.XWikiException; | ||
|
|
||
| /** | ||
| * Generic class to denote an exception condition within the GoogleApps code. Wraps XWikiException and IOException. | ||
| * | ||
| * @version $Id$ | ||
| * @since 3.0 | ||
| */ | ||
| public class GoogleAppsException extends RuntimeException | ||
| { | ||
|
|
||
| private static final long serialVersionUID = 3000; | ||
| /** | ||
|
polx marked this conversation as resolved.
|
||
| * @param msg Message to denote the error for programmers. | ||
| * @param wrapped Exception that has caused this one. | ||
| * | ||
| * @since 3.0 | ||
| */ | ||
| public GoogleAppsException(String msg, Exception wrapped) | ||
| { | ||
| super(msg, wrapped); | ||
| } | ||
|
|
||
| /** | ||
| * | ||
|
polx marked this conversation as resolved.
Outdated
|
||
| * @param msg Message to denote the error for programmers. | ||
| * | ||
| * @since 3.0 | ||
| */ | ||
| public GoogleAppsException(String msg) | ||
| { | ||
| super(msg); | ||
| } | ||
|
|
||
| /** | ||
| * | ||
| * @param wrapped Exception that has caused this one. | ||
| * | ||
| * @since 3.0 | ||
| */ | ||
| public GoogleAppsException(Exception wrapped) | ||
| { | ||
| super(wrapped); | ||
| } | ||
|
|
||
| /** | ||
| * | ||
| * @return true if the wrapped exception of XWiki origin. | ||
| * @since 3.0 | ||
| */ | ||
| @Unstable | ||
|
polx marked this conversation as resolved.
Outdated
|
||
| public boolean isWikiException() | ||
| { | ||
| return super.getCause() instanceof XWikiException; | ||
|
polx marked this conversation as resolved.
Outdated
|
||
| } | ||
|
|
||
| /** | ||
| * | ||
| * @return true if the wrapped exception of Google origin (for now: any IO-related exception). | ||
| * @since 3.0 | ||
| */ | ||
| @Unstable | ||
| public boolean isGoogleCommException() | ||
|
polx marked this conversation as resolved.
Outdated
|
||
| { | ||
| return super.getCause() instanceof IOException; | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why
RuntimeExceptionand notException? Since you have methods throwing it then it means its an "expected" exception, so code calling such a method should handle it.