Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. package com.qiita.nimzo6689.snippet.qrgen.schema;
  2.  
  3. import net.glxn.qrgen.core.scheme.EMail;
  4. import net.glxn.qrgen.javase.QRCode;
  5.  
  6. import java.io.File;
  7. import java.nio.file.Files;
  8. import java.nio.file.Paths;
  9. import java.nio.file.StandardCopyOption;
  10.  
  11. public class QRGenForEmail {
  12. public static void main(String[] args) throws Exception {
  13. EMail email = EMail.parse("mailto:taro.sato@example.com");
  14. File qrCode = QRCode.from(email).file();
  15. Files.copy(qrCode.toPath(), Paths.get("qrcode.png"), StandardCopyOption.REPLACE_EXISTING);
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement