@Test public void checkContractInPathRecursively() throws Exception { File dirFile = new File(rootPath + "contract_subfolder/"); if (!dirFile.exists()) dirFile.mkdir(); dirFile = new File(rootPath + "contract_subfolder/contract_subfolder_level2/"); if (!dirFile.exists()) dirFile.mkdir(); List<String> coinValues = Arrays.asList("5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60"); List<Contract> listOfCoinsWithAmount = createListOfCoinsWithAmount(coinValues); for (Contract coin : listOfCoinsWithAmount) { int rnd = new Random().nextInt(2); String dir = ""; switch (rnd) { case 0: dir += "contract_subfolder/"; break; case 1: dir += "contract_subfolder/contract_subfolder_level2/"; break; } CLIMain.saveContract(coin, rootPath + dir + "Coin_" + coin.getStateData().getStringOrThrow(FIELD_NAME) + ".unicon"); } Contract nonCoin = Contract.fromDslFile("./src/test_files/simple_root_contract_v2.yml"); nonCoin.seal(); CLIMain.saveContract(nonCoin, rootPath + "contract_subfolder/NonCoin.unicon"); CLIMain.saveContract(nonCoin, rootPath + "contract_subfolder/contract_subfolder_level2/NonCoin.unicon"); callMain("-ch", rootPath, "-v", "-r"); System.out.println(output); File[] filesToRemove = new File(rootPath + "contract_subfolder/").listFiles(); for (File file : filesToRemove) { file.delete(); } filesToRemove = new File(rootPath + "contract_subfolder/contract_subfolder_level2/").listFiles(); for (File file : filesToRemove) { file.delete(); } }
public static boolean saveContract(Contract contract, String fileName, Boolean fromPackedTransaction, Boolean addSigners) throws IOException { return saveContract(contract,fileName,fromPackedTransaction,addSigners,null); }
CLIMain { public static boolean saveContract(Contract contract, String fileName, Boolean fromPackedTransaction, Boolean addSigners) throws IOException { return saveContract(contract,fileName,fromPackedTransaction,addSigners,null); } }
CLIMain { public static boolean saveContract(Contract contract, String fileName, Boolean fromPackedTransaction, Boolean addSigners) throws IOException { return saveContract(contract,fileName,fromPackedTransaction,addSigners,null); }  }
CLIMain { public static boolean saveContract(Contract contract, String fileName, Boolean fromPackedTransaction, Boolean addSigners) throws IOException { return saveContract(contract,fileName,fromPackedTransaction,addSigners,null); }  static void main(String[] args); static PrivateKey getPrivateKey(); static BasicHttpClientSession getSession(int nodeNumber); static void breakSession(int nodeNumber); static void clearSession(); static void clearSession(boolean full); static void saveSession(); static void setVerboseMode(boolean verboseMode); static Contract loadContract(String fileName, Boolean fromPackedTransaction); static Parcel loadParcel(String fileName); static Contract loadContract(String fileName); static void exportContract(Contract contract, String fileName, String format, Boolean jsonPretty); static boolean saveContract(Contract contract, String fileName, Boolean fromPackedTransaction, Boolean addSigners); static boolean saveContract(Contract contract, String fileName, Boolean fromPackedTransaction, Boolean addSigners, Set<Contract> referencedItems); static boolean saveParcel(Parcel parcel, String fileName); static void saveContract(Contract contract, String fileName); static List<Wallet> findWallets(String path); static HashMap<String, Contract> findContracts(String path); static HashMap<String, Contract> findContracts(String path, Boolean recursively); static List<File> findFiles(String path, Boolean recursively); static Contract downloadContract(String url); static Parcel revokeContract(Contract contract, Contract u, int amount, Set<PrivateKey> uKeys, boolean withTestPayment, PrivateKey... key); @Deprecated static Contract revokeContract(Contract contract, PrivateKey... key); @Deprecated static void registerContract(Contract contract, int waitTime, Boolean fromPackedTransaction); static Parcel prepareForRegisterContract(Contract contract, Contract u, int amount, Set<PrivateKey> uKeys, boolean withTestPayment); static Parcel prepareForRegisterPayingParcel(Contract contract, Contract u, int amount, int amountStorage, Set<PrivateKey> uKeys, boolean withTestPayment); static ItemResult registerParcel(Parcel parcel, int waitTime); static void registerContract(Contract contract); static void registerContract(Contract contract, int waitTime); static void setTestMode(); static void setTestRootPath(String rootPath); static void setNodeNumber(int number); static void setNodeUrl(String url); static void setTopologyFileName(String filename); static void setPrivateKey(PrivateKey key); static Reporter getReporter(); static synchronized ClientNetwork getClientNetwork(); static synchronized Map<String, PrivateKey> keysMap(); static synchronized Map<String, PrivateKey> keysMapContract(); }
CLIMain { public static boolean saveContract(Contract contract, String fileName, Boolean fromPackedTransaction, Boolean addSigners) throws IOException { return saveContract(contract,fileName,fromPackedTransaction,addSigners,null); }  static void main(String[] args); static PrivateKey getPrivateKey(); static BasicHttpClientSession getSession(int nodeNumber); static void breakSession(int nodeNumber); static void clearSession(); static void clearSession(boolean full); static void saveSession(); static void setVerboseMode(boolean verboseMode); static Contract loadContract(String fileName, Boolean fromPackedTransaction); static Parcel loadParcel(String fileName); static Contract loadContract(String fileName); static void exportContract(Contract contract, String fileName, String format, Boolean jsonPretty); static boolean saveContract(Contract contract, String fileName, Boolean fromPackedTransaction, Boolean addSigners); static boolean saveContract(Contract contract, String fileName, Boolean fromPackedTransaction, Boolean addSigners, Set<Contract> referencedItems); static boolean saveParcel(Parcel parcel, String fileName); static void saveContract(Contract contract, String fileName); static List<Wallet> findWallets(String path); static HashMap<String, Contract> findContracts(String path); static HashMap<String, Contract> findContracts(String path, Boolean recursively); static List<File> findFiles(String path, Boolean recursively); static Contract downloadContract(String url); static Parcel revokeContract(Contract contract, Contract u, int amount, Set<PrivateKey> uKeys, boolean withTestPayment, PrivateKey... key); @Deprecated static Contract revokeContract(Contract contract, PrivateKey... key); @Deprecated static void registerContract(Contract contract, int waitTime, Boolean fromPackedTransaction); static Parcel prepareForRegisterContract(Contract contract, Contract u, int amount, Set<PrivateKey> uKeys, boolean withTestPayment); static Parcel prepareForRegisterPayingParcel(Contract contract, Contract u, int amount, int amountStorage, Set<PrivateKey> uKeys, boolean withTestPayment); static ItemResult registerParcel(Parcel parcel, int waitTime); static void registerContract(Contract contract); static void registerContract(Contract contract, int waitTime); static void setTestMode(); static void setTestRootPath(String rootPath); static void setNodeNumber(int number); static void setNodeUrl(String url); static void setTopologyFileName(String filename); static void setPrivateKey(PrivateKey key); static Reporter getReporter(); static synchronized ClientNetwork getClientNetwork(); static synchronized Map<String, PrivateKey> keysMap(); static synchronized Map<String, PrivateKey> keysMapContract(); static String DEFAULT_WALLET_PATH; static final String AMOUNT_FIELD_NAME; }