类 QrCodeHandler

java.lang.Object
cloud.opencode.base.tool.qrcode.QrCodeHandler

public class QrCodeHandler extends Object
版本:
v1.0.0
作者:
Jon So, e-mail: ijonso123@gmail.com url: Jon's blog url: project github
  • 构造器详细资料

    • QrCodeHandler

      public QrCodeHandler()
  • 方法详细资料

    • createQrCode2File

      public static String createQrCode2File(String codeText, String savePath, QrConfig config) throws com.google.zxing.WriterException, IOException
      Create a QR code and save it to the specified path
      参数:
      codeText - QR code text
      savePath - Save path
      抛出:
      com.google.zxing.WriterException
      IOException
    • createQrCode2Stream

      public static void createQrCode2Stream(String codeText, OutputStream outputStream, QrConfig config) throws com.google.zxing.WriterException, IOException
      Create QR code and write to stream
      参数:
      codeText - QR code text
      outputStream - stream
      抛出:
      com.google.zxing.WriterException
      IOException
    • decodeQrCode2Txt

      public static String decodeQrCode2Txt(String qrCodePath)
      Scan qrcode file and return text
      参数:
      qrCodePath - qrcode file path
      返回:
      qrcode text
    • getFile

      private static File getFile(String filePath)
      Get qrcode file
      参数:
      filePath -
      返回:
      File
    • checkCodeText

      private static String checkCodeText(String codeText)
      Check QR code text
      参数:
      codeText -
      返回:
      String
    • encodeQrCode

      private static BufferedImage encodeQrCode(String codeText, QrConfig config)
      Encode text to BufferedImage
      参数:
      codeText -
      返回:
      BufferedImage