本文整理了Java中utils.Utils
类的一些代码示例,展示了Utils
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils
类的具体详情如下:
包路径:utils.Utils
类名称:Utils
[英]Created by lingfengsan on 2018/1/12.
[中]凌峰三于2018年1月12日创作。
代码示例来源:origin: lingfengsan/MillionHero
@Override
public Long call() throws IOException {
if (needOpenBrowser) {
new Utils().openBrowser(path);
}
return search();
}
代码示例来源:origin: weizhenyi/leaf-snowflake
@Override
public void run() {
while(active.get() == true)
{
if( serverNodePath != null )
{
if (zkClient != null)
{
try {
zkClient.set_data(serverNodePath,Utils.barr(Utils.currentTimeMs()));
} catch (Exception e)
{
LOG.error("Faild to set heartBeat timestamp for path: " + serverNodePath);
}
}
}
Utils.sleepMs(interval);
}
}
});
代码示例来源:origin: weizhenyi/leaf-snowflake
public static String getData(DistributedClusterStat zkClusterState,
String path) throws Exception {
byte[] data = zkClusterState.get_data(path, false);
if (data == null || data.length == 0) {
return null;
}
return Long.valueOf(Utils.bytesTolong(data)).toString();
}
代码示例来源:origin: lingfengsan/MillionHero
public static void main(String[] args) {
String adb = "D:\\software\\Android\\android-sdk\\platform-tools\\adb";
String imagePath = "D:\\Photo";
Utils utils = new Utils(adb, imagePath);
utils.getImage();
}
}
代码示例来源:origin: weizhenyi/leaf-snowflake
String pidPath = Utils.createPid(conf);
LOG.info("Current leafServer pidPath: " + pidPath);
FileUtils.forceMkdir(new File(conf.get(Config.LEAF_HOME) + Config.FILE_SEPERATEOR + "logs"));
LOG.info("Current logDir :" + conf.get(Config.LEAF_HOME) + Config.FILE_SEPERATEOR + "logs");
FileUtils.forceMkdir(new File(Utils.localDataPath(conf)));
String dataDir = Utils.localDataPath(conf);
LOG.info("Current dataDir :" + dataDir);
zkClient.set_ephemeral_node(Utils.getEphemeralNodePath(conf),"".getBytes());
String serverNodePathPrefix = Utils.serverNodePathPrefix(conf);
String serverNodePath = makeServerNode(serverNodePathPrefix,Utils.barr(new Long(Utils.currentTimeMs())));
if (serverNodePath == null || serverNodePath.isEmpty())
Utils.halt_process(-1,"Failed to make serverNodePath , exit from the jvm");
Utils.halt_process(-1,"Got the wrong format serverNodePath , exit from the jvm");
Utils.halt_process(-1,"Got more than 1 serverid files,exit from the jvm.");
String zkServerNode = Utils.serverNodePath(conf,serverId);
byte [] timeStampBytes = zkClient.get_data(zkServerNode,true);
if (timeStampBytes == null || timeStampBytes.length != 8)
Utils.halt_process(-1,"Got no data from node,exit from the jvm.");
long timeStampMs = Utils.bytesTolong(timeStampBytes);
代码示例来源:origin: de.adorsys.multibanking/onlinebanking-hbci4java
booking.setOtherAccount(toBankAccount(line.other));
String differentInitiator = Utils.extractDifferentInitiator(booking.getUsage());
if (differentInitiator != null) {
booking.getOtherAccount().setOwner(booking.getOtherAccount().getOwner() + " " + differentInitiator);
booking.getOtherAccount().setIban(extractIban(booking.getUsage()));
getUsage(line.usage.size() > 0 ? line.usage : splitEqually(line.additional, 27)));
booking.setCreditorId((Utils.extractCreditorId(booking.getUsage())));
booking.setMandateReference(Utils.extractMandateReference(booking.getUsage()));
代码示例来源:origin: de.adorsys.multibanking/onlinebanking-finapi
booking.setCreditorId(Utils.extractCreditorId(transaction.getPurpose()));
booking.setMandateReference(Utils.extractMandateReference(transaction.getPurpose()));
booking.getOtherAccount().setName(transaction.getCounterpartName());
booking.getOtherAccount().setAccountNumber(transaction.getCounterpartAccountNumber());
booking.getOtherAccount().setIban(Utils.extractIban(transaction.getPurpose()));
代码示例来源:origin: de.adorsys.multibanking/onlinebanking-figo
public static Booking mapBooking(Transaction transaction, BankApi bankApi) {
Booking booking = new Booking();
booking.setExternalId(transaction.getTransactionId());
booking.setBankApi(bankApi);
booking.setBookingDate(transaction.getBookingDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
booking.setValutaDate(transaction.getValueDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
booking.setAmount(transaction.getAmount());
booking.setUsage(transaction.getPurposeText());
booking.setText(transaction.getBookingText());
booking.setTransactionCode(transaction.getTransactionCode());
booking.setOtherAccount(mapBookingAccount(transaction));
booking.setCreditorId(Utils.extractCreditorId(transaction.getPurposeText()));
booking.setMandateReference(Utils.extractMandateReference(transaction.getPurposeText()));
return booking;
}
代码示例来源:origin: de.adorsys.multibanking/multibanking-rest
.stream()
.filter(so -> so.getAmount().negate().compareTo(booking.getAmount()) == 0 &&
Utils.inCycle(booking.getValutaDate(), so.getExecutionDay()) &&
Utils.usageContains(booking.getUsage(), so.getUsage())
代码示例来源:origin: de.adorsys.multibanking/onlinebanking-figo
public static BankAccount mapBookingAccount(Transaction transaction) {
BankAccount bankAccount = new BankAccount();
bankAccount.setName(transaction.getName());
bankAccount.setBankName(transaction.getBankName());
bankAccount.setCurrency(transaction.getCurrency());
bankAccount.setAccountNumber(transaction.getAccountNumber());
bankAccount.setBlz(transaction.getBankCode());
bankAccount.setIban(Utils.extractIban(transaction.getPurposeText()));
return bankAccount;
}
代码示例来源:origin: lingfengsan/MillionHero
@Override
public void actionPerformed(ActionEvent e) {
Config.setAdbPath(adbPathText.getText());
Config.setPhotoPath(imagePathText.getText());
try {
Utils.storeConfig();
} catch (IOException e1) {
logger.error("存储配置信息失败");
}
Utils utils = new Utils(Config.getAdbPath(), Config.getPhotoPath());
COMMON_PATTERN.setUtils(utils);
COMMON_PATTERN.setPatterSelection(patternSelection);
COMMON_PATTERN.setSearchSelection(searchSelection);
}
};
代码示例来源:origin: weizhenyi/leaf-snowflake
public static String createPid( Map conf) throws Exception
{
String pidDir = PathUtils.leafPids(conf);
return createPid(pidDir);
}
代码示例来源:origin: weizhenyi/leaf-snowflake
public void mkdirs(CuratorFramework zk , String path) throws Exception
{
String npath = PathUtils.normalize_path(path);
// the node is "/"
if (npath.equals("/"))
{
return;
}
// the node exist
if (existsNode(zk,path,false)) //如果zk上面已经有该目录了
{
return;
}
mkdirs(zk,PathUtils.parent_path(npath));//递归创建父目录
try
{
createNode(zk,path,Utils.barr((byte)7),CreateMode.PERSISTENT);
}
catch (KeeperException e)
{
LOG.warn("zookeepr mkdir faild for " + path );
}
}
public void deleteNode(CuratorFramework zk , String path) throws Exception
代码示例来源:origin: de.adorsys.multibanking.docusafe/rest
.stream()
.filter(so -> so.getAmount().negate().compareTo(booking.getAmount()) == 0 &&
Utils.inCycle(booking.getValutaDate(), so.getExecutionDay()) &&
Utils.usageContains(booking.getUsage(), so.getUsage())
代码示例来源:origin: lingfengsan/MillionHero
@Override
public Long call() throws IOException {
if (needOpenBrowser) {
new Utils().openBrowser(path);
}
return search();
}
内容来源于网络,如有侵权,请联系作者删除!