Author: andrew.plotnikov
Date: 2012-02-13 09:28:42 -0500 (Mon, 13 Feb 2012)
New Revision: 5626
Modified:
jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DBBackup.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/CNDNodeTypeDataPersister.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CachingIndexReader.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ConsistencyCheck.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PropertiesSynonymProvider.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/PropertyDataOrderComparator.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ParentNodeEvictionActionPolicy.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/proccess/WorkerThread.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2ConnectionFactory.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileValueStorage.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileValueStorage.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/jbosscache/ExoJBossCacheFactory.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/ActionNonTxAware.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/BackupChainLog.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/DataDistributionByHash.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NewGroupListener.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NodeHierarchyCreatorImpl.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RESTRegistryService.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/JcrURLConnection.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/UnifiedNodeReference.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/jcr/Handler.java
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/client/FtpClientSessionImpl.java
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdPort.java
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdStor.java
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/listcode/FtpSystemCoderManager.java
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PropFindCommand.java
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/deltav/report/VersionTreeResponseEntity.java
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/propfind/PropFindResponseEntity.java
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/CollectionResource.java
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/util/MultipartByterangesEntity.java
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/GetNodeCommand.java
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/GetNodesCommand.java
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/GetPropertiesCommand.java
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/HelpCommand.java
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/MoveNodeCommand.java
jcr/branches/1.15.x/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/client/FtpClientSessionImpl.java
jcr/branches/1.15.x/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/commands/FtpCommandImpl.java
jcr/branches/1.15.x/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/data/FtpDataTransiverImpl.java
Log:
EXOJCR-1760: Fixed the Blocker/Critical violations and the easiest Major ones raised by
eXo Quality Level 1.2
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DBBackup.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DBBackup.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DBBackup.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -148,7 +148,7 @@
contentLenWriter.close();
}
}
- catch (Exception e)
+ catch (IOException e)
{
if (exc != null)
{
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -3208,43 +3208,38 @@
public int compare(P p1, P p2)
{
int r = 0;
- try
+
+ InternalQName qname1 = p1.getQPath().getName();
+ InternalQName qname2 = p2.getQPath().getName();
+ if (qname1.equals(Constants.JCR_PRIMARYTYPE))
{
- InternalQName qname1 = p1.getQPath().getName();
- InternalQName qname2 = p2.getQPath().getName();
- if (qname1.equals(Constants.JCR_PRIMARYTYPE))
- {
- r = Integer.MIN_VALUE;
- }
- else if (qname2.equals(Constants.JCR_PRIMARYTYPE))
- {
- r = Integer.MAX_VALUE;
- }
- else if (qname1.equals(Constants.JCR_MIXINTYPES))
- {
- r = Integer.MIN_VALUE + 1;
- }
- else if (qname2.equals(Constants.JCR_MIXINTYPES))
- {
- r = Integer.MAX_VALUE - 1;
- }
- else if (qname1.equals(Constants.JCR_UUID))
- {
- r = Integer.MIN_VALUE + 2;
- }
- else if (qname2.equals(Constants.JCR_UUID))
- {
- r = Integer.MAX_VALUE - 2;
- }
- else
- {
- r = qname1.getAsString().compareTo(qname2.getAsString());
- }
+ r = Integer.MIN_VALUE;
}
- catch (Exception e)
+ else if (qname2.equals(Constants.JCR_PRIMARYTYPE))
{
- LOG.error("PropertiesDataOrderComparator error: " + e, e);
+ r = Integer.MAX_VALUE;
}
+ else if (qname1.equals(Constants.JCR_MIXINTYPES))
+ {
+ r = Integer.MIN_VALUE + 1;
+ }
+ else if (qname2.equals(Constants.JCR_MIXINTYPES))
+ {
+ r = Integer.MAX_VALUE - 1;
+ }
+ else if (qname1.equals(Constants.JCR_UUID))
+ {
+ r = Integer.MIN_VALUE + 2;
+ }
+ else if (qname2.equals(Constants.JCR_UUID))
+ {
+ r = Integer.MAX_VALUE - 2;
+ }
+ else
+ {
+ r = qname1.getAsString().compareTo(qname2.getAsString());
+ }
+
return r;
}
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -2490,7 +2490,7 @@
}
}
}
- catch (Exception e)
+ catch (RepositoryException e)
{
log.error(e.getLocalizedMessage(), e);
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/CNDNodeTypeDataPersister.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/CNDNodeTypeDataPersister.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/CNDNodeTypeDataPersister.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -145,7 +145,6 @@
/**
* {@inheritDoc}
- * @see
org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTypeDataPersister#getNodeType(org.exoplatform.services.jcr.datamodel.InternalQName)
*/
public NodeTypeData getNodeType(InternalQName nodeTypeName) throws
RepositoryException
{
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -38,6 +38,7 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.jboss.cache.Cache;
+import org.jboss.cache.CacheException;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.config.CacheLoaderConfig;
@@ -48,6 +49,8 @@
import java.io.IOException;
import java.io.Serializable;
import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.Properties;
import javax.jcr.RepositoryException;
@@ -265,9 +268,9 @@
{
if (jmxManager != null)
{
- SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
+ SecurityHelper.doPrivilegedExceptionAction(new
PrivilegedExceptionAction<Void>()
{
- public Void run()
+ public Void run() throws CacheException
{
jmxManager.unregisterAllMBeans();
return null;
@@ -275,7 +278,7 @@
});
}
}
- catch (Exception e)
+ catch (PrivilegedActionException e)
{
log.warn("Not all JBoss Cache MBeans were unregistered.");
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CachingIndexReader.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CachingIndexReader.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CachingIndexReader.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -404,7 +404,7 @@
}
initializeParents(reader);
}
- catch (Exception e)
+ catch (IOException e)
{
// only log warn message during regular operation
if (!stopRequested)
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ConsistencyCheck.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ConsistencyCheck.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ConsistencyCheck.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -128,6 +128,17 @@
notRepairable++;
}
}
+ catch (IOException e)
+ {
+ if (ignoreFailure)
+ {
+ log.warn("Exception while reparing: " + e);
+ }
+ else
+ {
+ throw e;
+ }
+ }
catch (Exception e)
{
if (ignoreFailure)
@@ -136,11 +147,7 @@
}
else
{
- if (!(e instanceof IOException))
- {
- e = new IOException(e.getMessage());
- }
- throw (IOException)e;
+ throw new IOException(e.getMessage());
}
}
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -37,6 +37,7 @@
import org.exoplatform.services.jcr.impl.core.query.NodeDataIndexingIterator;
import org.exoplatform.services.jcr.impl.core.query.Reindexable;
import org.exoplatform.services.jcr.impl.core.query.lucene.directory.DirectoryManager;
+import org.exoplatform.services.rpc.RPCException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -554,13 +555,34 @@
scheduleFlushTask();
}
}
- catch (Exception e)
+ catch (IOException e)
{
String msg = "Error indexing workspace.";
IOException ex = new IOException(msg);
ex.initCause(e);
throw ex;
}
+ catch (RPCException e)
+ {
+ String msg = "Error indexing workspace.";
+ IOException ex = new IOException(msg);
+ ex.initCause(e);
+ throw ex;
+ }
+ catch (RepositoryException e)
+ {
+ String msg = "Error indexing workspace.";
+ IOException ex = new IOException(msg);
+ ex.initCause(e);
+ throw ex;
+ }
+ catch (SuspendException e)
+ {
+ String msg = "Error indexing workspace.";
+ IOException ex = new IOException(msg);
+ ex.initCause(e);
+ throw ex;
+ }
finally
{
setOnline(true, false);
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PropertiesSynonymProvider.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PropertiesSynonymProvider.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PropertiesSynonymProvider.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -91,9 +91,9 @@
configLastModified = System.currentTimeMillis();
lastCheck = System.currentTimeMillis();
}
- catch (Exception e)
+ catch (IOException e)
{
- throw Util.createIOException(e);
+ throw e;
}
}
@@ -131,18 +131,18 @@
return;
}
// check last modified
- try
- {
+ //try
+ //{
// if (configLastModified != config.lastModified()) {
// synonyms = getSynonyms(config);
// configLastModified = config.lastModified();
// log.info("Reloaded synonyms from {}",
config.getPath());
// }
- }
- catch (Exception e)
- {
- log.error("Exception while reading synonyms", e);
- }
+ //}
+ //catch (Exception e)
+ //{
+ //log.error("Exception while reading synonyms", e);
+ //}
// update lastCheck timestamp, even if error occured (retry later)
lastCheck = System.currentTimeMillis();
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -1709,11 +1709,21 @@
sp = synonymProviderClass.newInstance();
sp.initialize(createSynonymProviderConfigResource());
}
- catch (Exception e)
+ catch (IOException e)
{
log.warn("Exception initializing synonym provider: " +
synonymProviderClass, e);
sp = null;
}
+ catch (InstantiationException e)
+ {
+ log.warn("Exception initializing synonym provider: " +
synonymProviderClass, e);
+ sp = null;
+ }
+ catch (IllegalAccessException e)
+ {
+ log.warn("Exception initializing synonym provider: " +
synonymProviderClass, e);
+ sp = null;
+ }
}
return sp;
}
@@ -1823,10 +1833,18 @@
spCheck = spellCheckerClass.newInstance();
spCheck.init(SearchIndex.this, spellCheckerMinDistance,
spellCheckerMorePopular);
}
- catch (Exception e)
+ catch (IOException e)
{
log.warn("Exception initializing spell checker: " +
spellCheckerClass, e);
}
+ catch (InstantiationException e)
+ {
+ log.warn("Exception initializing spell checker: " +
spellCheckerClass, e);
+ }
+ catch (IllegalAccessException e)
+ {
+ log.warn("Exception initializing spell checker: " +
spellCheckerClass, e);
+ }
}
return spCheck;
}
@@ -2362,10 +2380,18 @@
Class<?> analyzerClass = ClassLoading.forName(analyzerClassName, this);
analyzer.setDefaultAnalyzer((Analyzer)analyzerClass.newInstance());
}
- catch (Exception e)
+ catch (ClassNotFoundException e)
{
log.warn("Invalid Analyzer class: " + analyzerClassName, e);
}
+ catch (InstantiationException e)
+ {
+ log.warn("Invalid Analyzer class: " + analyzerClassName, e);
+ }
+ catch (IllegalAccessException e)
+ {
+ log.warn("Invalid Analyzer class: " + analyzerClassName, e);
+ }
}
/**
@@ -2952,10 +2978,18 @@
Class<?> similarityClass = ClassLoading.forName(className, this);
similarity = (Similarity)similarityClass.newInstance();
}
- catch (Exception e)
+ catch (ClassNotFoundException e)
{
log.warn("Invalid Similarity class: " + className, e);
}
+ catch (InstantiationException e)
+ {
+ log.warn("Invalid Similarity class: " + className, e);
+ }
+ catch (IllegalAccessException e)
+ {
+ log.warn("Invalid Similarity class: " + className, e);
+ }
}
/**
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/PropertyDataOrderComparator.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/PropertyDataOrderComparator.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/PropertyDataOrderComparator.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -40,43 +40,38 @@
public int compare(PropertyData p1, PropertyData p2)
{
int r = 0;
- try
+
+ InternalQName qname1 = p1.getQPath().getName();
+ InternalQName qname2 = p2.getQPath().getName();
+ if (qname1.equals(Constants.JCR_PRIMARYTYPE))
{
- InternalQName qname1 = p1.getQPath().getName();
- InternalQName qname2 = p2.getQPath().getName();
- if (qname1.equals(Constants.JCR_PRIMARYTYPE))
- {
- r = Integer.MIN_VALUE;
- }
- else if (qname2.equals(Constants.JCR_PRIMARYTYPE))
- {
- r = Integer.MAX_VALUE;
- }
- else if (qname1.equals(Constants.JCR_MIXINTYPES))
- {
- r = Integer.MIN_VALUE + 1;
- }
- else if (qname2.equals(Constants.JCR_MIXINTYPES))
- {
- r = Integer.MAX_VALUE - 1;
- }
- else if (qname1.equals(Constants.JCR_UUID))
- {
- r = Integer.MIN_VALUE + 2;
- }
- else if (qname2.equals(Constants.JCR_UUID))
- {
- r = Integer.MAX_VALUE - 2;
- }
- else
- {
- r = qname1.getAsString().compareTo(qname2.getAsString());
- }
+ r = Integer.MIN_VALUE;
}
- catch (Exception e)
+ else if (qname2.equals(Constants.JCR_PRIMARYTYPE))
{
- LOG.error("PropertiesOrderComparator error: " + e, e);
+ r = Integer.MAX_VALUE;
}
+ else if (qname1.equals(Constants.JCR_MIXINTYPES))
+ {
+ r = Integer.MIN_VALUE + 1;
+ }
+ else if (qname2.equals(Constants.JCR_MIXINTYPES))
+ {
+ r = Integer.MAX_VALUE - 1;
+ }
+ else if (qname1.equals(Constants.JCR_UUID))
+ {
+ r = Integer.MIN_VALUE + 2;
+ }
+ else if (qname2.equals(Constants.JCR_UUID))
+ {
+ r = Integer.MAX_VALUE - 2;
+ }
+ else
+ {
+ r = qname1.getAsString().compareTo(qname2.getAsString());
+ }
+
return r;
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -979,17 +979,15 @@
{
super.save(logWrapper);
}
+ catch (RepositoryException e)
+ {
+ doRollback();
+ throw e;
+ }
catch (Exception e)
{
doRollback();
- if (e instanceof RepositoryException)
- {
- throw (RepositoryException)e;
- }
- else
- {
- throw new RepositoryException("Could not save the changes",
e);
- }
+ throw new RepositoryException("Could not save the changes", e);
}
doCommit();
// notify listeners after storage commit
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ParentNodeEvictionActionPolicy.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ParentNodeEvictionActionPolicy.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ParentNodeEvictionActionPolicy.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -92,7 +92,7 @@
}
}
}
- catch (Exception e)
+ catch (IllegalStateException e)
{
if (log.isDebugEnabled())
{
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -30,6 +30,7 @@
import org.exoplatform.services.transaction.TransactionService;
import java.lang.ref.SoftReference;
+import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
import java.util.HashSet;
@@ -180,11 +181,16 @@
return true;
}
}
- catch (Exception e)
+ catch (PrivilegedActionException e)
{
log.warn("Could not check if a global Tx has been started or register the
session into the resource manager",
e);
}
+ catch (SystemException e)
+ {
+ log.warn("Could not check if a global Tx has been started or register the
session into the resource manager",
+ e);
+ }
return false;
}
@@ -345,10 +351,18 @@
// Indicates that there is at least one after completion method to come
isLastAfterCompletion.set(false);
}
- catch (Exception e)
+ catch (RollbackException e)
{
log.error("Could not register the second synchronization", e);
}
+ catch (IllegalStateException e)
+ {
+ log.error("Could not register the second synchronization", e);
+ }
+ catch (SystemException e)
+ {
+ log.error("Could not register the second synchronization", e);
+ }
}
/**
@@ -669,10 +683,14 @@
{
tm.getTransaction().setRollbackOnly();
}
- catch (Exception e)
+ catch (IllegalStateException e)
{
log.warn("Could not set the status of the tx to
'rollback-only'", e);
}
+ catch (SystemException e)
+ {
+ log.warn("Could not set the status of the tx to
'rollback-only'", e);
+ }
}
private class TransactionContext
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/proccess/WorkerThread.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/proccess/WorkerThread.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/proccess/WorkerThread.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -61,13 +61,17 @@
callPeriodically();
sleep(timeout);
}
- catch (Exception e)
+ catch (InterruptedException e)
{
- if (!(e instanceof InterruptedException))
+ if (LOG.isTraceEnabled())
{
- LOG.error(e.getLocalizedMessage(), e);
+ LOG.trace("An exception occurred: " + e.getMessage());
}
}
+ catch (Exception e)
+ {
+ LOG.error(e.getLocalizedMessage(), e);
+ }
}
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -1344,7 +1344,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet ", e);
}
}
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2ConnectionFactory.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2ConnectionFactory.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2ConnectionFactory.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -207,11 +207,21 @@
isReindexingSupport = false;
}
}
- catch (Exception e)
+ catch (NumberFormatException e)
{
isReindexingSupport = false;
log.error("Error checking product version.", e);
}
+ catch (RepositoryException e)
+ {
+ isReindexingSupport = false;
+ log.error("Error checking product version.", e);
+ }
+ catch (SQLException e)
+ {
+ isReindexingSupport = false;
+ log.error("Error checking product version.", e);
+ }
finally
{
if (con != null)
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -36,6 +36,7 @@
import org.exoplatform.services.log.Log;
import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -102,11 +103,41 @@
.newInstance(holder.getFileCleaner());
}
- catch (Exception e)
+ catch (InstantiationException e)
{
log.error("Value Storage Plugin instantiation FAILED. ", e);
continue;
}
+ catch (IllegalArgumentException e)
+ {
+ log.error("Value Storage Plugin instantiation FAILED. ", e);
+ continue;
+ }
+ catch (SecurityException e)
+ {
+ log.error("Value Storage Plugin instantiation FAILED. ", e);
+ continue;
+ }
+ catch (IllegalAccessException e)
+ {
+ log.error("Value Storage Plugin instantiation FAILED. ", e);
+ continue;
+ }
+ catch (InvocationTargetException e)
+ {
+ log.error("Value Storage Plugin instantiation FAILED. ", e);
+ continue;
+ }
+ catch (NoSuchMethodException e)
+ {
+ log.error("Value Storage Plugin instantiation FAILED. ", e);
+ continue;
+ }
+ catch (ClassNotFoundException e)
+ {
+ log.error("Value Storage Plugin instantiation FAILED. ", e);
+ continue;
+ }
if (!(o instanceof ValueStoragePlugin))
{
log.error("Not a ValueStoragePlugin object IGNORED: " + o);
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileValueStorage.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileValueStorage.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileValueStorage.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -61,10 +61,18 @@
{
vcas = (ValueContentAddressStorage)ClassLoading.forName(vcasType,
this).newInstance();
}
- catch (Exception e)
+ catch (ClassNotFoundException e)
{
throw new RepositoryConfigurationException("VCAS Storage class load error
" + e, e);
}
+ catch (InstantiationException e)
+ {
+ throw new RepositoryConfigurationException("VCAS Storage class load error
" + e, e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new RepositoryConfigurationException("VCAS Storage class load error
" + e, e);
+ }
vcas.init(props);
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileValueStorage.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileValueStorage.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileValueStorage.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -62,10 +62,26 @@
{
vcas = (ValueContentAddressStorage)ClassLoading.forName(vcasType,
this).newInstance();
}
- catch (Exception e)
+ catch (ExceptionInInitializerError e)
{
throw new RepositoryConfigurationException("VCAS Storage class load error
" + e, e);
}
+ catch (SecurityException e)
+ {
+ throw new RepositoryConfigurationException("VCAS Storage class load error
" + e, e);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new RepositoryConfigurationException("VCAS Storage class load error
" + e, e);
+ }
+ catch (InstantiationException e)
+ {
+ throw new RepositoryConfigurationException("VCAS Storage class load error
" + e, e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new RepositoryConfigurationException("VCAS Storage class load error
" + e, e);
+ }
vcas.init(props);
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/jbosscache/ExoJBossCacheFactory.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/jbosscache/ExoJBossCacheFactory.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/jbosscache/ExoJBossCacheFactory.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -334,7 +334,7 @@
}
};
}
- catch (Exception e)
+ catch (IllegalArgumentException e)
{
log.error("Could not create the JMX Manager", e);
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/ActionNonTxAware.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/ActionNonTxAware.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/ActionNonTxAware.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -21,6 +21,7 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
@@ -57,7 +58,7 @@
{
tx = tm.suspend();
}
- catch (Exception e)
+ catch (SystemException e)
{
LOG.warn("Cannot suspend the current transaction", e);
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -43,7 +43,12 @@
import java.util.Set;
import java.util.concurrent.TimeUnit;
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.RollbackException;
import javax.transaction.Status;
+import javax.transaction.SystemException;
import javax.transaction.TransactionManager;
/**
@@ -1064,10 +1069,14 @@
isTxCreated = true;
}
}
- catch (Exception e)
+ catch (SystemException e)
{
LOG.warn("Could not create a new tx", e);
}
+ catch (NotSupportedException e)
+ {
+ LOG.warn("Could not create a new tx", e);
+ }
try
{
cacheChange.apply();
@@ -1094,13 +1103,35 @@
try
{
if (LOG.isTraceEnabled())
+ {
LOG.trace("The tx will be committed");
+ }
tm.commit();
}
- catch (Exception e)
+ catch (SystemException e)
{
LOG.warn("Could not commit the tx", e);
}
+ catch (SecurityException e)
+ {
+ LOG.warn("Could not commit the tx", e);
+ }
+ catch (IllegalStateException e)
+ {
+ LOG.warn("Could not commit the tx", e);
+ }
+ catch (RollbackException e)
+ {
+ LOG.warn("Could not commit the tx", e);
+ }
+ catch (HeuristicMixedException e)
+ {
+ LOG.warn("Could not commit the tx", e);
+ }
+ catch (HeuristicRollbackException e)
+ {
+ LOG.warn("Could not commit the tx", e);
+ }
}
}
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/BackupChainLog.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/BackupChainLog.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/BackupChainLog.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -41,6 +41,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.PrivilegedActionException;
@@ -296,10 +297,18 @@
logWriter.write(info, config);
}
- catch (Exception e)
+ catch (IOException e)
{
logger.error("Can't add job", e);
}
+ catch (XMLStreamException e)
+ {
+ logger.error("Can't add job", e);
+ }
+ catch (BackupOperationException e)
+ {
+ logger.error("Can't add job", e);
+ }
}
/**
@@ -365,11 +374,19 @@
out.close();
}
}
- catch (Exception e)
+
+ catch (FileNotFoundException e)
{
logger.error("Can't write log", e);
}
-
+ catch (UnsupportedEncodingException e)
+ {
+ logger.error("Can't write log", e);
+ }
+ catch (IOException e)
+ {
+ logger.error("Can't write log", e);
+ }
}
/**
@@ -1035,7 +1052,7 @@
writer.writeEndDocument();
writer.flush();
}
- catch (Exception e)
+ catch (XMLStreamException e)
{
logger.error("Can't write log", e);
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -44,6 +44,7 @@
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
+import java.util.regex.PatternSyntaxException;
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLInputFactory;
@@ -223,7 +224,7 @@
writer.writeEndDocument();
writer.flush();
}
- catch (Exception e)
+ catch (XMLStreamException e)
{
logger.error("Can't write end log", e);
}
@@ -780,10 +781,18 @@
out.close();
}
}
- catch (Exception e)
+ catch (PatternSyntaxException e)
{
logger.error("Can't write log", e);
}
+ catch (FileNotFoundException e)
+ {
+ logger.error("Can't write log", e);
+ }
+ catch (IOException e)
+ {
+ logger.error("Can't write log", e);
+ }
}
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -112,10 +112,18 @@
{
this.fullBackup = (AbstractFullBackupJob)ClassLoading.forName(fullBackupType,
this).newInstance();
}
- catch (Exception e)
+ catch (ClassNotFoundException e)
{
throw new BackupConfigurationException("FullBackupType error, " + e,
e);
}
+ catch (InstantiationException e)
+ {
+ throw new BackupConfigurationException("FullBackupType error, " + e,
e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new BackupConfigurationException("FullBackupType error, " + e,
e);
+ }
fullBackup.init(repository, config.getWorkspace(), config, timeStamp);
if (config.getBackupType() == BackupManager.FULL_AND_INCREMENTAL)
@@ -125,10 +133,18 @@
this.incrementalBackup =
(AbstractIncrementalBackupJob)ClassLoading.forName(incrementalBackupType,
this).newInstance();
}
- catch (Exception e)
+ catch (ClassNotFoundException e)
{
throw new BackupConfigurationException("IncrementalBackupType error,
" + e, e);
}
+ catch (InstantiationException e)
+ {
+ throw new BackupConfigurationException("IncrementalBackupType error,
" + e, e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new BackupConfigurationException("IncrementalBackupType error,
" + e, e);
+ }
incrementalBackup.init(repository, config.getWorkspace(), config, timeStamp);
periodConroller = new PeriodConroller(config.getIncrementalJobPeriod() * 1000);
// sec --> ms
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/DataDistributionByHash.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/DataDistributionByHash.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/DataDistributionByHash.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -18,8 +18,10 @@
*/
package org.exoplatform.services.jcr.ext.distribution.impl;
+import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
@@ -77,11 +79,21 @@
digest.update(dataId.getBytes("UTF-8"));
return new BigInteger(1, digest.digest()).toString(32);
}
- catch (Exception e)
+ catch (NumberFormatException e)
{
throw new RuntimeException("Could not generate the hash code of '"
+ dataId + "' with the algorithm '"
+ hashAlgorithm + "'", e);
}
+ catch (UnsupportedEncodingException e)
+ {
+ throw new RuntimeException("Could not generate the hash code of '"
+ dataId + "' with the algorithm '"
+ + hashAlgorithm + "'", e);
+ }
+ catch (NoSuchAlgorithmException e)
+ {
+ throw new RuntimeException("Could not generate the hash code of '"
+ dataId + "' with the algorithm '"
+ + hashAlgorithm + "'", e);
+ }
}
/**
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NewGroupListener.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NewGroupListener.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NewGroupListener.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -35,6 +35,7 @@
import java.util.Map;
import javax.jcr.Node;
+import javax.jcr.RepositoryException;
import javax.jcr.Session;
/**
@@ -119,7 +120,7 @@
Node groupsHome = (Node)session.getItem(groupsPath_);
dataDistributionType_.removeDataNode(groupsHome, groupId);
}
- catch (Exception e)
+ catch (RepositoryException e)
{
log.error("An error occurs while removing the group directory of
'" + groupId + "'", e);
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NodeHierarchyCreatorImpl.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NodeHierarchyCreatorImpl.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NodeHierarchyCreatorImpl.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -208,7 +208,7 @@
}
}
}
- catch (Exception e)
+ catch (RepositoryException e)
{
LOG.error("An error occurs while processing the JCR path which alias
is "
+ (currentjcrPath == null ? null : currentjcrPath.getAlias()) + "
with the workspace "
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RESTRegistryService.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RESTRegistryService.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RESTRegistryService.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -28,7 +28,9 @@
import org.exoplatform.services.rest.resource.ResourceContainer;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.security.PrivilegedExceptionAction;
@@ -36,6 +38,7 @@
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.PathNotFoundException;
+import javax.jcr.RepositoryException;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
@@ -51,6 +54,7 @@
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.dom.DOMSource;
/**
@@ -154,7 +158,7 @@
{
return Response.status(Response.Status.NOT_FOUND).build();
}
- catch (Exception e)
+ catch (RepositoryException e)
{
log.error("Get registry entry failed", e);
throw new WebApplicationException(e);
@@ -175,11 +179,31 @@
URI location = uriInfo.getRequestUriBuilder().path(entry.getName()).build();
return Response.created(location).build();
}
- catch (Exception e)
+ catch (IllegalArgumentException e)
{
log.error("Create registry entry failed", e);
throw new WebApplicationException(e);
}
+ catch (IOException e)
+ {
+ log.error("Create registry entry failed", e);
+ throw new WebApplicationException(e);
+ }
+ catch (SAXException e)
+ {
+ log.error("Create registry entry failed", e);
+ throw new WebApplicationException(e);
+ }
+ catch (ParserConfigurationException e)
+ {
+ log.error("Create registry entry failed", e);
+ throw new WebApplicationException(e);
+ }
+ catch (RepositoryException e)
+ {
+ log.error("Create registry entry failed", e);
+ throw new WebApplicationException(e);
+ }
}
@PUT
@@ -194,17 +218,41 @@
{
RegistryEntry entry = RegistryEntry.parse(entryStream);
if (createIfNotExist)
+ {
regService.updateEntry(sessionProvider, normalizePath(groupName), entry);
+ }
else
+ {
regService.recreateEntry(sessionProvider, normalizePath(groupName), entry);
+ }
URI location = uriInfo.getRequestUriBuilder().path(entry.getName()).build();
return Response.created(location).build();
}
- catch (Exception e)
+ catch (IllegalArgumentException e)
{
log.error("Re-create registry entry failed", e);
throw new WebApplicationException(e);
}
+ catch (IOException e)
+ {
+ log.error("Re-create registry entry failed", e);
+ throw new WebApplicationException(e);
+ }
+ catch (SAXException e)
+ {
+ log.error("Re-create registry entry failed", e);
+ throw new WebApplicationException(e);
+ }
+ catch (ParserConfigurationException e)
+ {
+ log.error("Re-create registry entry failed", e);
+ throw new WebApplicationException(e);
+ }
+ catch (RepositoryException e)
+ {
+ log.error("Re-create registry entry failed", e);
+ throw new WebApplicationException(e);
+ }
}
@DELETE
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/JcrURLConnection.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/JcrURLConnection.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/JcrURLConnection.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -28,6 +28,7 @@
import java.net.URLConnection;
import javax.jcr.Node;
+import javax.jcr.RepositoryException;
import javax.jcr.Session;
/**
@@ -146,11 +147,16 @@
{
return nodeRepresentation.getInputStream();
}
- catch (Exception e)
+ catch (IOException e)
{
//e.printStackTrace();
throw new IOException("can't get input stream");
}
+ catch (RepositoryException e)
+ {
+ //e.printStackTrace();
+ throw new IOException("can't get input stream");
+ }
}
/*
@@ -193,13 +199,20 @@
return nodeRepresentation.getMediaType();
}
- catch (Exception e)
+ catch (IOException e)
{
if (LOG.isTraceEnabled())
{
LOG.trace("An exception occurred: " + e.getMessage());
}
}
+ catch (RepositoryException e)
+ {
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+ }
return null;
}
@@ -219,13 +232,20 @@
return (int)nodeRepresentation.getContentLenght();
}
- catch (Exception e)
+ catch (IOException e)
{
if (LOG.isTraceEnabled())
{
LOG.trace("An exception occurred: " + e.getMessage());
}
}
+ catch (RepositoryException e)
+ {
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+ }
return -1;
}
@@ -283,13 +303,20 @@
return nodeRepresentation.getLastModified();
}
- catch (Exception e)
+ catch (IOException e)
{
if (LOG.isTraceEnabled())
{
LOG.trace("An exception occurred: " + e.getMessage());
}
}
+ catch (RepositoryException e)
+ {
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+ }
return 0;
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/UnifiedNodeReference.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/UnifiedNodeReference.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/UnifiedNodeReference.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -277,7 +277,7 @@
handler = (URLStreamHandler)cls.newInstance();
}
}
- catch (Exception e)
+ catch (ExceptionInInitializerError e)
{
// exceptions can get thrown here if class not be loaded y system
ClassLoader
// or if class can't be instantiated.
@@ -286,6 +286,42 @@
LOG.trace("An exception occurred: " + e.getMessage());
}
}
+ catch (SecurityException e)
+ {
+ // exceptions can get thrown here if class not be loaded y system
ClassLoader
+ // or if class can't be instantiated.
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+ }
+ catch (ClassNotFoundException e)
+ {
+ // exceptions can get thrown here if class not be loaded y system
ClassLoader
+ // or if class can't be instantiated.
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+ }
+ catch (InstantiationException e)
+ {
+ // exceptions can get thrown here if class not be loaded y system
ClassLoader
+ // or if class can't be instantiated.
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+ }
+ catch (IllegalAccessException e)
+ {
+ // exceptions can get thrown here if class not be loaded y system
ClassLoader
+ // or if class can't be instantiated.
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+ }
}
return handler;
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/jcr/Handler.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/jcr/Handler.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/jcr/Handler.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -20,6 +20,7 @@
import org.exoplatform.commons.utils.PrivilegedSystemHelper;
import org.exoplatform.services.jcr.RepositoryService;
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.core.ManageableRepository;
import org.exoplatform.services.jcr.ext.app.ThreadLocalSessionProviderService;
import org.exoplatform.services.jcr.ext.common.SessionProvider;
@@ -30,10 +31,13 @@
import org.picocontainer.Startable;
import java.io.IOException;
+import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;
+import javax.jcr.RepositoryException;
+
/**
* URLStreamHandler for protocol <tt>jcr://</tt>.
*
@@ -137,11 +141,21 @@
return conn;
}
- catch (Exception e)
+ catch (RepositoryException e)
{
//e.printStackTrace();
throw new IOException("Open connection to URL '" + url.toString()
+ "' failed!");
}
+ catch (URISyntaxException e)
+ {
+ //e.printStackTrace();
+ throw new IOException("Open connection to URL '" + url.toString()
+ "' failed!");
+ }
+ catch (RepositoryConfigurationException e)
+ {
+ //e.printStackTrace();
+ throw new IOException("Open connection to URL '" + url.toString()
+ "' failed!");
+ }
}
// Startable
Modified:
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/client/FtpClientSessionImpl.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/client/FtpClientSessionImpl.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/client/FtpClientSessionImpl.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -174,7 +174,7 @@
{
clientSocket.close();
}
- catch (Exception exc)
+ catch (IOException exc)
{
log.info("Unhandled exception. " + exc.getMessage(), exc);
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdPort.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdPort.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdPort.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -63,7 +63,7 @@
host.append(ports[3]);
port = new Integer(ports[4]) * 256 + new Integer(ports[5]);
}
- catch (Exception exc)
+ catch (NumberFormatException exc)
{
reply(String.format(FtpConst.Replyes.REPLY_500_ILLEGAL, "PORT"));
return;
Modified:
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdStor.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdStor.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdStor.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -217,7 +217,7 @@
{
inputStream.close();
}
- catch (Exception exc)
+ catch (IOException exc)
{
LOG.info("Failurinc closing input stream");
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/listcode/FtpSystemCoderManager.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/listcode/FtpSystemCoderManager.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/listcode/FtpSystemCoderManager.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -52,10 +52,18 @@
(FtpSystemCoder)ClassLoading.forName(availableSysemCoders[i][1],
FtpSystemCoderManager.class).newInstance();
return coder;
}
- catch (Exception exc)
+ catch (ClassNotFoundException exc)
{
log.info("Unhandled exception. " + exc.getMessage(), exc);
}
+ catch (InstantiationException exc)
+ {
+ log.info("Unhandled exception. " + exc.getMessage(), exc);
+ }
+ catch (IllegalAccessException exc)
+ {
+ log.info("Unhandled exception. " + exc.getMessage(), exc);
+ }
}
}
return null;
Modified:
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PropFindCommand.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PropFindCommand.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PropFindCommand.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -24,6 +24,7 @@
import org.exoplatform.services.jcr.webdav.command.propfind.PropFindResponseEntity;
import org.exoplatform.services.jcr.webdav.resource.CollectionResource;
import org.exoplatform.services.jcr.webdav.resource.FileResource;
+import org.exoplatform.services.jcr.webdav.resource.IllegalResourceTypeException;
import org.exoplatform.services.jcr.webdav.resource.Resource;
import org.exoplatform.services.jcr.webdav.resource.ResourceUtil;
import org.exoplatform.services.jcr.webdav.resource.VersionedCollectionResource;
@@ -36,6 +37,7 @@
import org.exoplatform.services.rest.ExtHttpHeaders;
import java.net.URI;
+import java.net.URISyntaxException;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -132,11 +134,21 @@
}
}
- catch (Exception e1)
+ catch (RepositoryException e1)
{
log.error(e1.getMessage(), e1);
return Response.serverError().build();
}
+ catch (URISyntaxException e1)
+ {
+ log.error(e1.getMessage(), e1);
+ return Response.serverError().build();
+ }
+ catch (IllegalResourceTypeException e1)
+ {
+ log.error(e1.getMessage(), e1);
+ return Response.serverError().build();
+ }
PropFindRequestEntity request = new PropFindRequestEntity(body);
PropFindResponseEntity response;
Modified:
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/deltav/report/VersionTreeResponseEntity.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/deltav/report/VersionTreeResponseEntity.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/deltav/report/VersionTreeResponseEntity.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -37,6 +37,7 @@
import javax.ws.rs.core.StreamingOutput;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
/**
@@ -128,11 +129,16 @@
xmlStreamWriter.writeEndElement();
xmlStreamWriter.writeEndDocument();
}
- catch (Exception exc)
+ catch (XMLStreamException exc)
{
log.error(exc.getMessage(), exc);
throw new IOException(exc.getMessage());
}
+ catch (RepositoryException exc)
+ {
+ log.error(exc.getMessage(), exc);
+ throw new IOException(exc.getMessage());
+ }
}
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/propfind/PropFindResponseEntity.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/propfind/PropFindResponseEntity.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/propfind/PropFindResponseEntity.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -147,11 +147,26 @@
// rootNode.accept(this);
}
- catch (Exception exc)
+ catch (XMLStreamException exc)
{
log.error(exc.getMessage(), exc);
throw new IOException(exc.getMessage());
}
+ catch (RepositoryException exc)
+ {
+ log.error(exc.getMessage(), exc);
+ throw new IOException(exc.getMessage());
+ }
+ catch (IllegalResourceTypeException exc)
+ {
+ log.error(exc.getMessage(), exc);
+ throw new IOException(exc.getMessage());
+ }
+ catch (URISyntaxException exc)
+ {
+ log.error(exc.getMessage(), exc);
+ throw new IOException(exc.getMessage());
+ }
}
/**
Modified:
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/CollectionResource.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/CollectionResource.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/CollectionResource.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -182,11 +182,34 @@
{
props.add((namesOnly) ? new HierarchicalProperty(name) :
getProperty(name));
}
- catch (Exception exc)
+ catch (UnsupportedOperationException exc)
{
if (LOG.isDebugEnabled())
+ {
LOG.error(exc.getMessage(), exc);
+ }
}
+ catch (ClassCastException exc)
+ {
+ if (LOG.isDebugEnabled())
+ {
+ LOG.error(exc.getMessage(), exc);
+ }
+ }
+ catch (IllegalArgumentException exc)
+ {
+ if (LOG.isDebugEnabled())
+ {
+ LOG.error(exc.getMessage(), exc);
+ }
+ }
+ catch (PathNotFoundException exc)
+ {
+ if (LOG.isDebugEnabled())
+ {
+ LOG.error(exc.getMessage(), exc);
+ }
+ }
}
}
Modified:
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/util/MultipartByterangesEntity.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/util/MultipartByterangesEntity.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/util/MultipartByterangesEntity.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -32,6 +32,7 @@
import java.io.OutputStream;
import java.util.List;
+import javax.jcr.RepositoryException;
import javax.ws.rs.core.StreamingOutput;
/**
@@ -120,11 +121,16 @@
print("--" + WebDavConst.BOUNDARY + "--", ostream);
println(ostream);
}
- catch (Exception exc)
+ catch (IOException exc)
{
log.error(exc.getMessage(), exc);
throw new IOException("Can't write to stream, caused " + exc);
}
+ catch (RepositoryException exc)
+ {
+ log.error(exc.getMessage(), exc);
+ throw new IOException("Can't write to stream, caused " + exc);
+ }
}
/**
Modified:
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/GetNodeCommand.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/GetNodeCommand.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/GetNodeCommand.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -19,6 +19,8 @@
package org.exoplatform.frameworks.jcr.cli;
import javax.jcr.Node;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.RepositoryException;
/**
* Created by The eXo Platform SAS
@@ -42,10 +44,18 @@
ctx.setCurrentItem(resultNode);
output = "Current node: " + resultNode.getPath() + "\n";
}
- catch (Exception e)
+ catch (ParameterNotFoundException e)
{
output = "Can't execute command - " + e.getMessage() +
"\n";
}
+ catch (PathNotFoundException e)
+ {
+ output = "Can't execute command - " + e.getMessage() +
"\n";
+ }
+ catch (RepositoryException e)
+ {
+ output = "Can't execute command - " + e.getMessage() +
"\n";
+ }
ctx.setOutput(output);
return false;
}
Modified:
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/GetNodesCommand.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/GetNodesCommand.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/GetNodesCommand.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -22,6 +22,7 @@
import javax.jcr.NodeIterator;
import javax.jcr.Property;
import javax.jcr.PropertyIterator;
+import javax.jcr.RepositoryException;
/**
* Created by The eXo Platform SAS
@@ -62,7 +63,7 @@
output.append("Current item is property:
").append(((Property)ctx.getCurrentItem()).getName()).append("\n");
}
}
- catch (Exception e)
+ catch (RepositoryException e)
{
output = new StringBuilder("Can't execute command -
").append(e.getMessage()).append("\n");
}
Modified:
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/GetPropertiesCommand.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/GetPropertiesCommand.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/GetPropertiesCommand.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -21,6 +21,7 @@
import javax.jcr.Node;
import javax.jcr.Property;
import javax.jcr.PropertyIterator;
+import javax.jcr.RepositoryException;
/**
* Created by The eXo Platform SAS
@@ -47,7 +48,7 @@
output.append(property.getName()).append("\n");
}
}
- catch (Exception e)
+ catch (RepositoryException e)
{
output = new StringBuilder("Can't execute command -
").append(e.getMessage()).append("\n");
}
Modified:
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/HelpCommand.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/HelpCommand.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/HelpCommand.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -82,7 +82,7 @@
{
findHelpCommand = ctx.getParameter(0);
}
- catch (Exception e)
+ catch (ParameterNotFoundException e)
{
if (LOG.isTraceEnabled())
{
Modified:
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/MoveNodeCommand.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/MoveNodeCommand.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/MoveNodeCommand.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -18,6 +18,9 @@
*/
package org.exoplatform.frameworks.jcr.cli;
+import javax.jcr.LoginException;
+import javax.jcr.NoSuchWorkspaceException;
+import javax.jcr.RepositoryException;
import javax.jcr.Workspace;
/**
@@ -41,10 +44,22 @@
workspace.move(srcAbsPath, destAbsPath);
output = "Node [" + srcAbsPath + "] has been moved to [" +
destAbsPath + "] successfully \n";
}
- catch (Exception e)
+ catch (ParameterNotFoundException e)
{
output = "Can't execute command - " + e.getMessage() +
"\n";
}
+ catch (LoginException e)
+ {
+ output = "Can't execute command - " + e.getMessage() +
"\n";
+ }
+ catch (NoSuchWorkspaceException e)
+ {
+ output = "Can't execute command - " + e.getMessage() +
"\n";
+ }
+ catch (RepositoryException e)
+ {
+ output = "Can't execute command - " + e.getMessage() +
"\n";
+ }
ctx.setOutput(output);
return false;
}
Modified:
jcr/branches/1.15.x/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/client/FtpClientSessionImpl.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/client/FtpClientSessionImpl.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/client/FtpClientSessionImpl.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -25,6 +25,7 @@
import org.exoplatform.services.log.Log;
import java.io.BufferedReader;
+import java.io.IOException;
import java.io.InputStreamReader;
import java.net.InetSocketAddress;
import java.net.Socket;
@@ -134,7 +135,7 @@
clientSocket.close();
}
}
- catch (Exception exc)
+ catch (IOException exc)
{
log.info(FtpConst.EXC_MSG + exc.getMessage(), exc);
}
Modified:
jcr/branches/1.15.x/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/commands/FtpCommandImpl.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/commands/FtpCommandImpl.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/commands/FtpCommandImpl.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -23,6 +23,7 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import java.io.IOException;
import java.io.OutputStream;
/**
@@ -48,17 +49,10 @@
public int run(FtpClientSession clientSession)
{
this.clientSession = clientSession;
- try
- {
- // outPrintStream = new
PrintStream(clientSession.getClientSocket().getOutputStream());
- int status = execute();
- return status;
- }
- catch (Exception exc)
- {
- log.info("Unhandled exception. " + exc.getMessage(), exc);
- }
- return -1;
+
+ // outPrintStream = new
PrintStream(clientSession.getClientSocket().getOutputStream());
+ int status = execute();
+ return status;
}
public abstract int execute();
@@ -74,7 +68,7 @@
outStream.write(data);
outStream.write("\r\n".getBytes());
}
- catch (Exception exc)
+ catch (IOException exc)
{
log.info("Unhandled exception. " + exc.getMessage(), exc);
}
Modified:
jcr/branches/1.15.x/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/data/FtpDataTransiverImpl.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/data/FtpDataTransiverImpl.java 2012-02-13
12:13:09 UTC (rev 5625)
+++
jcr/branches/1.15.x/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/data/FtpDataTransiverImpl.java 2012-02-13
14:28:42 UTC (rev 5626)
@@ -23,6 +23,7 @@
import org.exoplatform.services.log.Log;
import java.io.ByteArrayOutputStream;
+import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
@@ -140,7 +141,7 @@
dataSocket.close();
}
}
- catch (Exception exc)
+ catch (IOException exc)
{
LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
@@ -158,7 +159,7 @@
dataSocket.close();
return true;
}
- catch (Exception exc)
+ catch (IOException exc)
{
LOG.info(FtpConst.EXC_MSG + exc.getMessage(), exc);
}