catch (MalformedURLException mue)
{
Logging.connectors.error("MalformedURLException tossed",mue);
activities.recordActivity(null,ACTIVITY_ACCESS,
null,documentIdentifier,"Error","Malformed URL: "+mue.getMessage(),null);
throw new ManifoldCFException("MalformedURLException tossed: "+mue.getMessage(),mue);
}
catch (jcifs.smb.SmbAuthException e)
{
Logging.connectors.warn("JCIFS: Authorization exception reading document/directory "+documentIdentifier+" - skipping");
activities.recordActivity(null,ACTIVITY_ACCESS,
null,documentIdentifier,"Skip","Authorization: "+e.getMessage(),null);
// We call the delete even if it's a directory; this is harmless.
activities.deleteDocument(documentIdentifier, version);
}
catch (SmbException se)
{
// At least some of these are transport errors, and should be treated as service
// interruptions.
long currentTime = System.currentTimeMillis();
Throwable cause = se.getRootCause();
if (cause != null && (cause instanceof jcifs.util.transport.TransportException))
{
// See if it's an interruption
jcifs.util.transport.TransportException te = (jcifs.util.transport.TransportException)cause;
if (te.getRootCause() != null && te.getRootCause() instanceof java.lang.InterruptedException)
throw new ManifoldCFException(te.getRootCause().getMessage(),te.getRootCause(),ManifoldCFException.INTERRUPTED);
Logging.connectors.warn("JCIFS: Timeout processing document/directory "+documentIdentifier+": retrying...",se);
activities.recordActivity(null,ACTIVITY_ACCESS,
null,documentIdentifier,"Retry","Transport: "+cause.getMessage(),null);
throw new ServiceInterruption("Timeout or other service interruption: "+cause.getMessage(),cause,currentTime + 300000L,
currentTime + 12 * 60 * 60000L,-1,false);
}
if (se.getMessage().indexOf("busy") != -1)
{
Logging.connectors.warn("JCIFS: 'Busy' response when processing document/directory for "+documentIdentifier+": retrying...",se);
activities.recordActivity(null,ACTIVITY_ACCESS,
null,documentIdentifier,"Retry","Busy: "+se.getMessage(),null);
throw new ServiceInterruption("Timeout or other service interruption: "+se.getMessage(),se,currentTime + 300000L,
currentTime + 3 * 60 * 60000L,-1,false);
}
else if (se.getMessage().indexOf("handle is invalid") != -1)
{
Logging.connectors.warn("JCIFS: 'Handle is invalid' response when processing document/directory for "+documentIdentifier+": retrying...",se);
activities.recordActivity(null,ACTIVITY_ACCESS,
null,documentIdentifier,"Retry","Expiration: "+se.getMessage(),null);
throw new ServiceInterruption("Timeout or other service interruption: "+se.getMessage(),se,currentTime + 300000L,
currentTime + 3 * 60 * 60000L,-1,false);
}
else if (se.getMessage().indexOf("parameter is incorrect") != -1)
{
Logging.connectors.warn("JCIFS: 'Parameter is incorrect' response when processing document/directory for "+documentIdentifier+": retrying...",se);
activities.recordActivity(null,ACTIVITY_ACCESS,
null,documentIdentifier,"Retry","Expiration: "+se.getMessage(),null);
throw new ServiceInterruption("Timeout or other service interruption: "+se.getMessage(),se,currentTime + 300000L,
currentTime + 3 * 60 * 60000L,-1,false);
}
else if (se.getMessage().indexOf("no longer available") != -1)
{
Logging.connectors.warn("JCIFS: 'No longer available' response when processing document/directory for "+documentIdentifier+": retrying...",se);
activities.recordActivity(null,ACTIVITY_ACCESS,
null,documentIdentifier,"Retry","Expiration: "+se.getMessage(),null);
throw new ServiceInterruption("Timeout or other service interruption: "+se.getMessage(),se,currentTime + 300000L,
currentTime + 3 * 60 * 60000L,-1,false);
}
else if (se.getMessage().indexOf("cannot find") != -1 || se.getMessage().indexOf("cannot be found") != -1)
{
if (Logging.connectors.isDebugEnabled())
Logging.connectors.debug("JCIFS: Skipping document/directory "+documentIdentifier+" because it cannot be found");
activities.recordActivity(null,ACTIVITY_ACCESS,
null,documentIdentifier,"Not found",null,null);
activities.deleteDocument(documentIdentifier, version);
}
else if (se.getMessage().indexOf("is denied") != -1)
{
Logging.connectors.warn("JCIFS: Access exception reading document/directory "+documentIdentifier+" - skipping");
// We call the delete even if it's a directory; this is harmless and it cleans up the jobqueue row.
activities.recordActivity(null,ACTIVITY_ACCESS,
null,documentIdentifier,"Skip","Authorization: "+se.getMessage(),null);
activities.deleteDocument(documentIdentifier, version);
}
else
{
Logging.connectors.error("JCIFS: SmbException tossed processing "+documentIdentifier,se);
activities.recordActivity(null,ACTIVITY_ACCESS,
null,documentIdentifier,"Error","Unknown: "+se.getMessage(),null);
throw new ManifoldCFException("SmbException tossed: "+se.getMessage(),se);
}
}
catch (java.net.SocketTimeoutException e)
{
long currentTime = System.currentTimeMillis();
Logging.connectors.warn("JCIFS: Socket timeout processing "+documentIdentifier+": "+e.getMessage(),e);
activities.recordActivity(null,ACTIVITY_ACCESS,
null,documentIdentifier,"Retry","Socket timeout: "+e.getMessage(),null);
throw new ServiceInterruption("Timeout or other service interruption: "+e.getMessage(),e,currentTime + 300000L,
currentTime + 3 * 60 * 60000L,-1,false);
}
catch (InterruptedIOException e)
{
throw new ManifoldCFException("Interrupted: "+e.getMessage(),e,ManifoldCFException.INTERRUPTED);
}
catch (IOException e)
{
long currentTime = System.currentTimeMillis();
Logging.connectors.warn("JCIFS: IO error processing "+documentIdentifier+": "+e.getMessage(),e);