initialized = false;
}
}
public boolean createNewFile() throws IOException {
DBBroker broker = null;
BrokerPool db = null;
TransactionManager tm;
try {
try {
db = BrokerPool.getInstance();
broker = db.get(null);
} catch (final EXistException e) {
throw new IOException(e);
}
// if (!uri.startsWith("/db"))
// uri = XmldbURI.DB.append(uri);
//
try {
if (uri.endsWith("/"))
{throw new IOException("It collection, but should be resource: "+uri);}
} catch (final Exception e) {
throw new IOException(e);
}
final XmldbURI collectionURI = uri.removeLastSegment();
collection = broker.getCollection(collectionURI);
if (collection == null)
{throw new IOException("Collection not found: "+collectionURI);}
final XmldbURI fileName = uri.lastSegment();
// try {
// resource = broker.getXMLResource(uri, Lock.READ_LOCK);
// } catch (final PermissionDeniedException e1) {
// } finally {
// if (resource != null) {
// resource.getUpdateLock().release(Lock.READ_LOCK);
// collection = resource.getCollection();
// initialized = true;
//
// return false;
// }
// }
//
try {
resource = broker.getResource(uri, Lock.READ_LOCK);
} catch (final PermissionDeniedException e1) {
} finally {
if (resource != null) {
resource.getUpdateLock().release(Lock.READ_LOCK);
collection = resource.getCollection();