📄 randomaccessfilestoragefactory.java
字号:
// You can redistribute this software and/or modify it under the terms of// the Ozone Core License version 1 published by ozone-db.org.//// Copyright (C) 2003-@year@, Leo Mekenkamp. All rights reserved.//// $Id: RandomAccessFileStorageFactory.java,v 1.1 2004/01/02 09:24:38 leomekenkamp Exp $package org.ozoneDB.core.storage.gammaStore;import java.io.File;import java.io.IOException;import java.util.Collection;import java.util.List;import java.util.Properties;import java.util.logging.Logger;import org.ozoneDB.core.storage.PropertyInfo;/** * @author <a href="mailto:leoATmekenkampD0Tcom">Leo Mekenkamp (mind the anti sp@m)</a> * @version $Id: RandomAccessFileStorageFactory.java,v 1.1 2004/01/02 09:24:38 leomekenkamp Exp $ */public class RandomAccessFileStorageFactory extends FileStorageFactory { private static Logger log = Logger.getLogger(RandomAccessFileStorageFactory.class.getName()); public static final PropertyInfo MODE = new PropertyInfo( ".mode", "one of r, rw, rws, rwd", "rws", "mode for opening the storage files; see mode in java.util.RandomAccessFile#RandomAccessFile(java.io.File, String)", new String[] { "rw", "rwd" } ); private String mode; /** * As prescribed by the <code>PropertyConfigurable</code> interface. */ public RandomAccessFileStorageFactory(Properties properties, String prefix) { super(properties, prefix); String property = getPrefix() + MODE.getKey(); setMode(properties.getProperty(property, MODE.getDefaultValue())); } public Storage createStorage(String name) throws IOException { File file = nameToFile(name); ensureParentsExist(file); return new RandomAccessFileStorage(file, getMode()); } // private so it can be inlined private String getMode() { return mode; } // private so it can be inlined private void setMode(String mode) { this.mode = mode; } public Collection getPropertyInfos() { Collection result = super.getPropertyInfos(); result.add(MODE); return result; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -