Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,6 @@
<version>v2-rev358-1.24.1</version>
</dependency>
</dependencies>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/xwikisas/application-googleapps/issues</url>
</issueManagement>
<scm>
<connection>scm:git:git://github.com/xwikisas/application-googleapps.git</connection>
<developerConnection>scm:git:git@github.com:xwikisas/application-googleapps.git</developerConnection>
<url>https://github.com/xwikisas/application-googleapps</url>
<tag>HEAD</tag>
</scm>
<build>
<plugins>
<plugin>
Expand All @@ -76,12 +66,6 @@
<configuration>
<failOnViolation>false</failOnViolation>
</configuration>
<executions>
<execution>
<id>checkstyle-validation</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
47 changes: 47 additions & 0 deletions api/src/main/java/com/xwiki/googleapps/DriveDocMetadata.java
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 api/src/main/java/com/xwiki/googleapps/GoogleAppsException.java
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why RuntimeException and not Exception? Since you have methods throwing it then it means its an "expected" exception, so code calling such a method should handle it.

{

private static final long serialVersionUID = 3000;
/**
Comment thread
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);
}

/**
*
Comment thread
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
Comment thread
polx marked this conversation as resolved.
Outdated
public boolean isWikiException()
{
return super.getCause() instanceof XWikiException;
Comment thread
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()
Comment thread
polx marked this conversation as resolved.
Outdated
{
return super.getCause() instanceof IOException;
}
}
Loading