当前位置: 首页>>代码示例>>Java>>正文


Java Database.getFilePath方法代码示例

本文整理汇总了Java中lotus.domino.Database.getFilePath方法的典型用法代码示例。如果您正苦于以下问题:Java Database.getFilePath方法的具体用法?Java Database.getFilePath怎么用?Java Database.getFilePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lotus.domino.Database的用法示例。


在下文中一共展示了Database.getFilePath方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createLocalDatabaseReplica

import lotus.domino.Database; //导入方法依赖的package包/类
public static String createLocalDatabaseReplica(Database db, String destDbName) throws Throwable {
    Database newDb = null;
    String newDbPath = null;
    try {
        // Make a replica of the database
        newDb = db.createReplica(null, destDbName);
        newDbPath = newDb.getFilePath();
    } finally {
        if (newDb != null) {
            try {
                // Ensure db is flushed to disk
                newDb.recycle();
                // Add a pause for safety, just in case another thread handles the flush
                Thread.sleep(1000);
            } catch (NotesException e) {
                if (BluemixLogger.BLUEMIX_LOGGER.isErrorEnabled()) {
                    BluemixLogger.BLUEMIX_LOGGER.errorp(null, "createLocalDatabaseReplica", e, "Failed to recycle newDb");  // $NON-NLS-1$ $NLE-BluemixUtil.FailedtorecyclenewDb.1-2$
                }
            }
        }
    }
    
    return newDbPath;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:25,代码来源:BluemixUtil.java

示例2: createLocalDatabaseCopy

import lotus.domino.Database; //导入方法依赖的package包/类
public static String createLocalDatabaseCopy(Database db, String destDbName) throws Throwable {
    Database newDb = null;
    String newDbPath = null;
    try {
        // Make a copy of the database
        newDb = db.createCopy(null, destDbName);
        newDbPath = newDb.getFilePath();
            
        // Copy all the docs
        DocumentCollection col = db.getAllDocuments();
        Document doc = col.getFirstDocument();
        while (doc != null) {
            doc.copyToDatabase(newDb);
            doc = col.getNextDocument();
        }
        
        // Copy the profile docs
        col = db.getProfileDocCollection(null);
        doc = col.getFirstDocument();
        while (doc != null) {
            doc.copyToDatabase(newDb);
            doc = col.getNextDocument();
        }
    } finally {
        if (newDb != null) {
            try {
                // Ensure db is flushed to disk
                newDb.recycle();
                // Add a pause for safety, just in case another thread handles the flush
                Thread.sleep(1000);
            } catch (NotesException e) {
                if (BluemixLogger.BLUEMIX_LOGGER.isErrorEnabled()) {
                    BluemixLogger.BLUEMIX_LOGGER.errorp(null, "createLocalDatabaseCopy", e, "Failed to recycle newDb"); // $NON-NLS-1$ $NLE-BluemixUtil.FailedtorecyclenewDb-2$
                }
            }
        }
    }
    
    return newDbPath;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:41,代码来源:BluemixUtil.java

示例3: setImpl

import lotus.domino.Database; //导入方法依赖的package包/类
protected void setImpl(Database database, Delegate delegate, Document profile) throws ModelException, NotesException {
    AdministrationProcess adminp = null;
    
    try {
        Session session = database.getParent();
        
        // Can't modify the owner's access
        
        String owner = profile.getItemValueString(OWNER_ITEM);
        verifyDelegateNotOwner(session, delegate.getName(), owner);
        
        // Can't modify a delegate that's not there
        
        Vector[] vectors = loadVectors(profile);
        Name name = session.createName(delegate.getName());
        if ( !delegateExists(vectors, name.getCanonical()) ) {
            throw new ModelException("Delegate not found", ModelException.ERR_NOT_FOUND); // $NON-NLS-1$
        }
        
        // Update the right vector(s)

        delegateRemove(vectors, name.getCanonical());
        delegateAdd(vectors, name.getCanonical(), delegate.getAccess());
        
        // Send the adminp request
        
        String mailFile = database.getFilePath();
        String server = session.getServerName();
        
        adminp = session.createAdministrationProcess(null);
        String unid = adminp.delegateMailFile(owner, 
                            vectors[0], vectors[1], vectors[2], vectors[3], vectors[4], vectors[5],  
                            null, mailFile, server);
    }
    finally {
        BackendUtil.safeRecycle(adminp);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:39,代码来源:Delegate901Provider.java

示例4: addImpl

import lotus.domino.Database; //导入方法依赖的package包/类
protected void addImpl(Database database, Delegate delegate, Document profile) throws ModelException, NotesException {
    AdministrationProcess adminp = null;
    
    try {
        Session session = database.getParent();
        
        // Can't add the owner as a delegate
        
        String owner = profile.getItemValueString(OWNER_ITEM);
        verifyDelegateNotOwner(session, delegate.getName(), owner);
        
        // Can't add someone that's already there
        
        Vector[] vectors = loadVectors(profile);
        Name name = session.createName(delegate.getName());
        if ( delegateExists(vectors, name.getCanonical()) ) {
            throw new ModelException("A delegate of that name already exists", ModelException.ERR_CONFLICT); // $NON-NLS-1$
        }
        
        // Add the delegate to the right vector(s)
        
        delegateAdd(vectors, name.getCanonical(), delegate.getAccess());
        
        // Send the adminp request
        
        String mailFile = database.getFilePath();
        String server = session.getServerName();
        
        adminp = session.createAdministrationProcess(null);
        String unid = adminp.delegateMailFile(owner, 
                            vectors[0], vectors[1], vectors[2], vectors[3], vectors[4], vectors[5],  
                            null, mailFile, server);
    }
    finally {
        BackendUtil.safeRecycle(adminp);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:38,代码来源:Delegate901Provider.java

示例5: deleteImpl

import lotus.domino.Database; //导入方法依赖的package包/类
protected void deleteImpl(Database database, String name, Document profile) throws ModelException, NotesException {
    AdministrationProcess adminp = null;
    
    try {
        Session session = database.getParent();
        
        // Can't remove the owner
        
        String owner = profile.getItemValueString(OWNER_ITEM);
        verifyDelegateNotOwner(session, name, owner);
        
        // Can't remove a delegate that's not there
        
        Vector[] vectors = loadVectors(profile);
        Name no = session.createName(name);
        if ( !delegateExists(vectors, no.getCanonical()) ) {
            throw new ModelException("Delegate not found", ModelException.ERR_NOT_FOUND); // $NON-NLS-1$
        }

        // Send the adminp request
        
        Vector removeList = new Vector();
        removeList.add(no.getCanonical());
        
        String mailFile = database.getFilePath();
        String server = session.getServerName();
        
        adminp = session.createAdministrationProcess(null);
        String unid = adminp.delegateMailFile(owner, 
                            null, null, null, null, null, null, 
                            removeList, mailFile, server);
    }
    finally {
        BackendUtil.safeRecycle(adminp);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:37,代码来源:Delegate901Provider.java

示例6: NABDb

import lotus.domino.Database; //导入方法依赖的package包/类
NABDb(Database db) throws NotesException {
    this(db.getFilePath(),db.getTitle());
    this.publicNab = db.isPublicAddressBook();
    this.privateNab = db.isPrivateAddressBook();
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:6,代码来源:DominoNABNamePickerData.java

示例7: localFileExists

import lotus.domino.Database; //导入方法依赖的package包/类
private boolean localFileExists(Session session, String filepath) throws NotesException {
    boolean exists = false;
    DbDirectory dbdir = null;
    Database localDb = null;
    
    try {
        try {
            // Optimistically attempt to open the database
            localDb = session.getDatabase(null, filepath, false);
            if ( localDb != null ) {
                exists = true;
            }
        }
        catch (NotesException e) {
            if ( e.id == NotesError.NOTES_ERR_DBNOACCESS ) {
                // An access error proves the database exists
                exists = true;
            }
            else {
                // Ignore other errors and fall into the exhaustive search below.
            }
        }
        
        if ( !exists) {
            
            // Exhaustive search of database directory
            
            dbdir = session.getDbDirectory(null);
            Database database = dbdir.getFirstDatabase(DbDirectory.DATABASE);
            while ( database != null ) {
                
                String path = database.getFilePath();
                if ( filepath.equals(path) ) {
                    // TODO: Make sure this is database is really a replica of the user's mail file.
                    // Usually replicas have the same name, but it's not guaranteed.
        
                    exists = true;
                    break;
                }
                
                Database next = dbdir.getNextDatabase();
                BackendUtil.safeRecycle(database);
                database = next;
            }
        }
    }
    finally {
        BackendUtil.safeRecycle(localDb);
        BackendUtil.safeRecycle(dbdir);
    }
    
    return exists;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:54,代码来源:UserHelper.java


注:本文中的lotus.domino.Database.getFilePath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。