com.scudata.util.FileSyncManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of esproc Show documentation
Show all versions of esproc Show documentation
SPL(Structured Process Language) A programming language specially for structured data computing.
package com.scudata.util;
import java.io.File;
import java.util.HashMap;
import com.scudata.dm.FileObject;
/**
* ????ȡ?ļ???ͬ??????
* ???߳????ļ?ʱ?????????ͬ?????????ļ?ȡ??ͬ??????????ͬ??
* @author RunQian
*
*/
public final class FileSyncManager {
// ?ļ???ͬ??????ӳ??
private static HashMap fileMap = new HashMap();
/**
* ȡ???ļ???ͬ?????????ļ?ʱ?ڴ˶????ϼ???
* @param fo ?ļ?????
* @return Object ????ͬ??????
*/
public static Object getSyncObject(FileObject fo) {
//LocalFile lf = fo.getLocalFile();
//File file = lf.file();
//return getSyncObject(file);
return fo;
}
/**
* ȡ???ļ???ͬ?????????ļ?ʱ?ڴ˶????ϼ???
* @param file ?ļ?
* @return Object ????ͬ??????
*/
public static Object getSyncObject(File file) {
synchronized(fileMap) {
File f = fileMap.get(file);
if (f == null) {
fileMap.put(file, file);
return file;
} else {
return f;
}
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy