@@ -0,0 +1,2634 @@
+package com.marcusman.packageify;%0A%0Aimport java.io.File;%0A%0A/**%0A* Packageify puts files that were originally all in the same folder%0A* in organized packages based on input information.%0A*%0A* %3Cpre%3E%0A* Program arguments:%0A* (path to folder with all java files) (package definition txt file) (output folder)%0A* %0A* Example of package definition file:%0A* AnimatedSprite;com.marcusman.graphics.AnimatedSprite%0A* Game;com.marcusman.Game%0A* GameObject;com.marcusman.utils.GameObject%0A* GUI;com.marcusman.graphics.gui.GUI%0A* GUIButton;com.marcusman.graphics.gui.GUIButton%0A* KeyBoardListener;com.marcusman.input.KeyBoardListener%0A* Map;com.marcusman.logic.Map%0A* MouseEventListener;com.marcusman.input.MouseEventListener%0A* Player;com.marcusman.logic.Player%0A* Rectangle;com.marcusman.utils.Rectangle%0A* RenderHandler;com.marcusman.graphics.RenderHandler%0A* SDKButton;com.marcusman.graphics.gui.SDKButton%0A* Sprite;com.marcusman.graphics.Sprite%0A* SpriteSheet;com.marcusman.graphics.SpriteSheet%0A* Tiles;com.marcusman.logic.Tiles%0A* %3C/pre%3E%0A* @author Marcus Dubreuil%0A* @version 1.0%0A*/%0Apublic class Packageify %7B%0A%0A%09private File inputFolder;%0A%09private File definitionFile;%0A%09private File outputFolder;%0A%0A%09/**%0A%09* Packageify the given directory with the description given above%0A%09* @param args args%5B0%5D = inputFolder args%5B1%5D = definitionFile args%5B2%5D = outputFolder%0A%09*/%0A%09public Packageify(String%5B%5D args) throws IllegalArgumentException %7B%0A%09%09if(args.length %3C 3)%0A%09%09%09throw new IllegalArgumentException(%22Expected at least 3 arguments and Received %22 + args.length + %22!%22);%0A%0A%09%09inputFolder = new File(args%5B0%5D);%0A%09%09definitionFile = new File(args%5B1%5D);%0A%09%09outputFolder = new File(args%5B2%5D);%0A%09%09validateFiles();%0A%0A%09%7D%0A%0A%09/**%0A%09* Validate that all 3 files and directories (inputFolder, definitionFile, and outputFile) exist%0A%09* or are accessible%0A%09*/%0A%09private void validateFiles() %7B%0A%09%09if(!inputFolder.exists())%0A%09%09%09throw new IllegalArgumentException(%22Input folder does not exist!%22);%0A%0A%09%09if(!inputFolder.isDirectory())%0A%09%09%09throw new IllegalArgumentException(%22Input folder is not a directory!%22);%0A%0A%09%09File%5B%5D files = inputFolder.listFiles();%0A%0A%09%09if(files.length == 0)%0A%09%09%09throw new IllegalArgumentException(%22Input folder contains no files!%22);%0A%0A%09%09boolean foundJava = false;%0A%0A%09%09for(int i = 0; i %3C files.length; i++)%0A%09%09%09if(files%5Bi%5D.getName().endsWith(%22.java%22))%0A%09%09%09%09foundJava = true;%0A%0A%09%09if(!foundJava)%0A%09%09%09throw new IllegalArgumentException(%22Input folder does not contain any Java files!%22);%0A%0A%09%09if(!definitionFile.exists())%0A%09%09%09throw new IllegalArgumentException(%22Package Definition File does not exist!%22);%0A%0A%09%09outputFolder.mkdirs();%0A%0A%09%7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        new Packageify(args);%0A    %7D%0A%7D%0A

Create main file and Add checks for arguments