ControlC
· Pastebin
Login
Register
ControlC
/
Create paste
Paste content
Up to 100 KB of text. BBCode formatting is supported.
Title
- optional
Content
B
I
U
S
</>
Colors ↓
Sizes ↓
Size 1
Size 2
Size 3
Size 4
Size 5
Size 6
Size 7
import net.lingala.zip4j.ZipFile;\r\nimport net.lingala.zip4j.exception.ZipException;\r\nimport net.lingala.zip4j.model.ZipParameters;\r\nimport net.lingala.zip4j.model.enums.EncryptionMethod;\r\nimport net.lingala.zip4j.model.enums.AesKeyStrength;\r\nimport java.io.File;\r\nimport java.io.IOException;\r\n\r\npublic class SampleClass{\r\n\r\n public static void main(String[] args)\r\n throws ZipException,\r\n IOException{\r\n ZipFile zip = null;\r\n \r\n try{\r\n zip = new ZipFile\r\n (\"myzip.zip\", \"password\".toCharArray());\r\n ZipParameters zp = new ZipParameters();\r\n zp.setEncryptFiles(true);\r\n zp.setEncryptionMethod\r\n (EncryptionMethod.AES);\r\n zp.setAesKeyStrength\r\n (AesKeyStrength.KEY_STRENGTH_256);\r\n \r\n zip.createSplitZipFileFromFolder\r\n (new File(\"folder\"), zp, true, 81920);\r\n }\r\n finally{\r\n if(zip != null)\r\n zip.close();\r\n }\r\n \r\n System.out.println\r\n (\"main thread end\");\r\n }\r\n}
Password
Anyone with the link will still need this password to view.
Expires
1 hour
3 hours
6 hours
12 hours
24 hours
48 hours
72 hours
Sign in to enable "Never expires".
Create paste
Please verify you are human
Cancel