mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-10-04 19:42:01 +08:00
sqliteUtil implementation
This commit is contained in:
1 parent
33b3d40855
commit
72512834e4
4 files changed
+58
-4
No files matched your search
@@ -1,4 +1,16 @@
|
||||
package minsecurity.identity.persist.sqlite;
|
||||
|
||||
/*
|
||||
* @Author: zhengqi wu
|
||||
* @Description: Sqlite封装
|
||||
* @Version: 1.0.0
|
||||
* @Date: 22:34 2021/04/01
|
||||
* @Copyright: MIN-Group;国家重大科技基础设施——未来网络北大实验室;深圳市信息论与未来网络重点实验室
|
||||
*/
|
||||
|
||||
public class Sqlite {
|
||||
|
||||
public static String home(){
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package minsecurity.identity.persist.sqlite;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/*
|
||||
* @Author: zhengqi wu
|
||||
* @Description: sqlite工具类封装
|
||||
* @Version: 1.0.0
|
||||
* @Date: 10:34 2021/03/10
|
||||
* @Copyright: MIN-Group;国家重大科技基础设施——未来网络北大实验室;深圳市信息论与未来网络重点实验室
|
||||
*/
|
||||
public final class SqliteUtil {
|
||||
// Home returns the home directory for the executing user.
|
||||
//
|
||||
// This uses an OS-specific method for discovering the home directory.
|
||||
// An error is returned if a home directory cannot be detected.
|
||||
public static String home()
|
||||
{
|
||||
String usrHome = System.getProperty("user.home");
|
||||
return usrHome;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断文件是否存在
|
||||
* @param path 特定文件路径
|
||||
* @return 判断结果
|
||||
*/
|
||||
public static boolean pathExists(String path){
|
||||
File file = new File(path);
|
||||
return file.exists();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package minsecurity.identity.persist.sqlite;
|
||||
|
||||
public class SqliteUtils {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package minsecurity.identity.sqlite;
|
||||
|
||||
import minsecurity.identity.persist.sqlite.SqliteUtil;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
public class SqliteTest {
|
||||
@Test
|
||||
public void testHome(){
|
||||
System.out.println(SqliteUtil.home());
|
||||
assertFalse(SqliteUtil.pathExists("/aaa/1.txt"));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user