类 LocalBinaryStore
java.lang.Object
gu.sql2java.store.BaseURLStore
gu.sql2java.store.BasesLocalBinaryStore
gu.sql2java.store.LocalBinaryStore
- 所有已实现的接口:
URLStore,URLStreamHandlerFactory
二进制数据本地存储实现
- 作者:
- guyadong
-
字段概要
字段从类继承的字段 gu.sql2java.store.BasesLocalBinaryStore
storeRoot从类继承的字段 gu.sql2java.store.BaseURLStore
additionalParams -
构造器概要
构造器构造器说明LocalBinaryStore(File storeRoot, String partition, int level) LocalBinaryStore(String storeRoot, String partition, int level) -
方法概要
修饰符和类型方法说明将存储URL替换路径前缀,转为protocol,host,port指定的标准 URLasRelativePath(URL storedUrl, String prefix) 返回存储URL相对路径asStoredURL(URL canonicalUrl) 将输入的URL转转为本地存储URLprotected URLcreateStoreURL(File file) 创建存储地址对象(将path中storeRoot路径剥离)protected URL查找指定MD5的二进制数据protected URL存储图像数据booleaninthashCode()protected FilelocalFolderOf(String md5) 根据MD5计算出对应的存储路径protected intmatchRelativePath(String path) 正则表达匹配判断是路径后部否为本地存储路径(), 如8b/ce/8bce0bb6de7e5c025a4a06e3d05edce7.tx如果是则返回匹配的相对路径的起始位置,否则返回-1protected StringrelativeFilePath(String md5, String suffix) setStoreRoot(File storeRoot) toString()从类继承的方法 gu.sql2java.store.BasesLocalBinaryStore
asNativeUrl, doDelete, doExists, doGetURLStreamHandler, getProtocol, getStoreRoot, pathOf从类继承的方法 gu.sql2java.store.BaseURLStore
createURLStreamHandler, delete, delete, exists, find, intall, isStored, setAdditionalParam, store, store
-
字段详细资料
-
PROTOCOL
- 另请参阅:
-
SINGLETON
分区名为'origin',存储级数为2的单实例
-
-
构造器详细资料
-
LocalBinaryStore
- 参数:
storeRoot- 存储根路径partition- 存储路径前缀(分区),为null或空则使用默认值'origin'level- 存储目录级数,小于0或大于4则使用默认值2- 另请参阅:
-
levelFolderOf(String, String)
-
LocalBinaryStore
-
-
方法详细资料
-
createStoreURL
创建存储地址对象(将path中storeRoot路径剥离)- 参数:
file-- 返回:
- 存储地址URL
-
doFind
从类复制的说明:BaseURLStore查找指定MD5的二进制数据- 指定者:
doFind在类中BaseURLStore- 参数:
md5- MD5校验码- 返回:
- 数据存储URL,找不到返回
null
-
doStore
protected URL doStore(byte[] binary, String md5, String extension, boolean overwrite, boolean makeURLOnly) throws IOException 从类复制的说明:BaseURLStore存储图像数据- 指定者:
doStore在类中BaseURLStore- 参数:
binary- 二进制数据字节数组md5- imageBytes的MD5校验码extension- 文件后缀,可为nulloverwrite- 文件存在时是否重写makeURLOnly- 为true时不存储数据只返回存储URL- 返回:
- 存储URL
- 抛出:
IOException
-
asRelativePath
返回存储URL相对路径- 参数:
storedUrl-prefix- 需要替换的路径前缀, 为null直接返回URL的 path部分
-
asCanonicalURL
将存储URL替换路径前缀,转为protocol,host,port指定的标准 URL- 参数:
storedUrl-protocol- 为null则默认为httphost-port- 为null为默认端口prefix-- 另请参阅:
-
asStoredURL
将输入的URL转转为本地存储URL- 参数:
canonicalUrl-
-
setStoreRoot
-
getPartition
-
relativeFilePath
-
localFolderOf
根据MD5计算出对应的存储路径 -
matchRelativePath
正则表达匹配判断是路径后部否为本地存储路径(), 如8b/ce/8bce0bb6de7e5c025a4a06e3d05edce7.tx如果是则返回匹配的相对路径的起始位置,否则返回-1 -
hashCode
public int hashCode()- 覆盖:
hashCode在类中BasesLocalBinaryStore
-
equals
- 覆盖:
equals在类中BasesLocalBinaryStore
-
toString
- 覆盖:
toString在类中BasesLocalBinaryStore
-