本文整理了Java中org.robovm.apple.foundation.NSURL.getPath()
方法的一些代码示例,展示了NSURL.getPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NSURL.getPath()
方法的具体详情如下:
包路径:org.robovm.apple.foundation.NSURL
类名称:NSURL
方法名:getPath
暂无
代码示例来源:origin: playn/playn
public RoboStorage(RoboPlatform platform) {
this.platform = platform;
String dbDir = null;
try {
// we access SqlLite via JDBC... egads
try {
Class.forName("SQLite.JDBCDriver");
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
dbDir = NSFileManager.getDefaultManager().getURLsForDirectory(
NSSearchPathDirectory.DocumentDirectory,
NSSearchPathDomainMask.UserDomainMask).get(0).getPath();
File dbFile = new File(dbDir, platform.config.storageFileName);
dbFile.getParentFile().mkdirs();
platform.log().info("Using db in file: " + dbFile.getAbsolutePath());
conn = DriverManager.getConnection("jdbc:sqlite:" + dbFile.getAbsolutePath());
// create our schema if needed
try (Statement stmt = conn.createStatement()) {
stmt.executeUpdate("CREATE TABLE IF NOT EXISTS " +
"Data (DataKey ntext PRIMARY KEY, DataValue ntext NOT NULL)");
}
} catch (SQLException sqe) {
throw new RuntimeException("Failed to initialize storage [dbDir=" + dbDir + "]", sqe);
}
}
代码示例来源:origin: threerings/playn
public RoboStorage(RoboPlatform platform) {
this.platform = platform;
String dbDir = null;
try {
// we access SqlLite via JDBC... egads
try {
Class.forName("SQLite.JDBCDriver");
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
dbDir = NSFileManager.getDefaultManager().getURLsForDirectory(
NSSearchPathDirectory.DocumentDirectory,
NSSearchPathDomainMask.UserDomainMask).get(0).getPath();
File dbFile = new File(dbDir, platform.config.storageFileName);
dbFile.getParentFile().mkdirs();
platform.log().info("Using db in file: " + dbFile.getAbsolutePath());
conn = DriverManager.getConnection("jdbc:sqlite:" + dbFile.getAbsolutePath());
// create our schema if needed
try (Statement stmt = conn.createStatement()) {
stmt.executeUpdate("CREATE TABLE IF NOT EXISTS " +
"Data (DataKey ntext PRIMARY KEY, DataValue ntext NOT NULL)");
}
} catch (SQLException sqe) {
throw new RuntimeException("Failed to initialize storage [dbDir=" + dbDir + "]", sqe);
}
}
内容来源于网络,如有侵权,请联系作者删除!