if ( _revokeIfRegistered )
{
doing = "revoking previously registered data source"; try
{
dbContext.revokeObject( _registrationName );
} catch( NoSuchElementException e )
{ /* allowed here */ }
}
// if the document associated with the database document has not yet been saved, then we need to do so
DatabaseDocument doc = getDatabaseDocument();
String docURL = doc.getURL(); if ( docURL.length() == 0 )
{ final java.io.File tempFile = java.io.File.createTempFile( _registrationName + "_", ".odb" ); if ( tempFile.exists() ) { // we did not really want to create that file, we just wanted its local name, but // createTempFile actually creates it => throw it away // (This is necessary since some JVM/platform combinations seem to actually lock the file) boolean bDeleteOk = tempFile.delete(); if (!bDeleteOk) {
System.out.println("delete failed");
}
}
String localPart = tempFile.toURI().toURL().toString();
localPart = localPart.substring( localPart.lastIndexOf( '/' ) + 1 );
docURL = util.utils.getOfficeTemp( m_orb ) + localPart;
doing = "storing database document to temporary location (" + docURL + ")";
doc.storeAsURL( docURL );
}
// register the data source
doing = "registering the data source at the database context";
dbContext.registerObject( _registrationName, m_dataSource );
} catch( final java.lang.Exception e )
{ thrownew StatusException( "DataSource.registerAs: error during " + doing, e );
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.