Last active
December 30, 2015 09:19
-
-
Save RomanVlasenko/7808557 to your computer and use it in GitHub Desktop.
Copy resource files from java to resources folder (maven style)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.IOException; | |
/** | |
* @author Roman Vlasenko (RVL) / WorldTicket A/S | |
* @version $Revision: 1.0 $ $Date: 12/5/13 $ | |
*/ | |
public class FileMover { | |
public static void main(String args[]) { | |
final String SEARCH_FOLDER = "/home/rvl/projects/worldticket/maven/sms-test-integration/src/test/java/net/worldticket/tools"; | |
try { | |
displayIt(new File(SEARCH_FOLDER)); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} | |
public static void displayIt(File node) throws IOException { | |
if (!node.getAbsoluteFile().getName().endsWith(".java") && node.getAbsoluteFile().isFile()) { | |
System.out.println("hg mv " + node.getAbsoluteFile().toString() + " " + node.getAbsoluteFile().toString().replace("/java/", "/resources/")); | |
} | |
if (node.isDirectory()) { | |
String[] subNote = node.list(); | |
for (String filename : subNote) { | |
displayIt(new File(node, filename)); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment