Class WalletService


  • public class WalletService
    extends java.lang.Object
    Service methods to manipulate wallets
    Since:
    0.0.1
    Author:
    Alexandre Carvalho, Andre Bertolace
    • Constructor Summary

      Constructors 
      Constructor Description
      WalletService()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Wallet loadWalletFromFile​(java.io.File file)
      Loads a wallet from filesystem
      static void writeWalletToFile​(java.io.File file, Wallet wallet)
      Writes a wallet to filesystem
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WalletService

        public WalletService()
    • Method Detail

      • loadWalletFromFile

        public static Wallet loadWalletFromFile​(java.io.File file)
                                         throws java.io.IOException
        Loads a wallet from filesystem
        Parameters:
        file - the file to read from
        Returns:
        a wallet with loaded content
        Throws:
        java.io.IOException - thrown if file not found or not a valid wallet json
      • writeWalletToFile

        public static void writeWalletToFile​(java.io.File file,
                                             Wallet wallet)
                                      throws java.io.IOException
        Writes a wallet to filesystem
        Parameters:
        file - the file to write to
        wallet - the wallet to persist
        Throws:
        java.io.IOException - thrown if file could not be written