How To Re-Create A Folder From Jboss Deployment To Your Local Machine

The code below volition re-create a folder from a deployed application inwards jboss to a local folder inwards your machine. This is useful if you lot desire to deploy something, perchance a railroad train of configuration files on your local automobile on deployment.

 File destinationDir = novel File(destinationFolder); if (!destinationDir.exists()) {  destinationDir.mkdirs();   //get the folder path from resources  String sourcePath = Thread.currentThread().getContextClassLoader().getResource("./jasper").getPath();  File sourceFile = novel File(sourcePath);  if (!sourceFile.exists()) {   //get the vfs path   VirtualFile vfDir = VFS.getChild("/content/"     + ParamBean.getInstance().getProperty("meveo.moduleName", "meveo")     + ".war/WEB-INF/classes/jasper");   URL vfPath = VFSUtils.getPhysicalURL(vfDir);   sourceFile = novel File(vfPath.getPath());   if (!sourceFile.exists()) {    throw novel Exception("missing source");   }  }    //copy the resources files to local automobile  FileUtils.copyDirectory(sourceFile, destinationDir); }   
Next
Previous
Click here for Comments

0 komentar:

Please comment if there are any that need to be asked.