Source:
ExtractRegistry() throws IngestModuleException, FileNotFoundException { moduleName = NbBundle.getMessage(ExtractIE.class, "ExtractRegistry.moduleName.text"); final File rrRoot = InstalledFileLocator.getDefault().locate("rr", ExtractRegistry.class.getPackage().getName(), false); if (rrRoot == null) { throw new IngestModuleException(Bundle.RegRipperNotFound()); } final File rrFullRoot = InstalledFileLocator.getDefault().locate("rr-full", ExtractRegistry.class.getPackage().getName(), false); if (rrFullRoot == null) { throw new IngestModuleException(Bundle.RegRipperFullNotFound()); } String executableToRun = RIP_EXE; if (!PlatformUtil.isWindowsOS()) { executableToRun = RIP_PL; } rrHome = rrRoot.toPath(); RR_PATH = rrHome.resolve(executableToRun).toString(); rrFullHome = rrFullRoot.toPath(); RR_FULL_PATH = rrFullHome.resolve(executableToRun).toString(); if (!(new File(RR_PATH).exists())) { throw new IngestModuleException(Bundle.RegRipperNotFound()); } if (!(new File(RR_FULL_PATH).exists())) { throw new IngestModuleException(Bundle.RegRipperFullNotFound()); } if(PlatformUtil.isWindowsOS()){ rrCmd.add(RR_PATH); rrFullCmd.add(RR_FULL_PATH); }else{ File usrBin = new File("/usr/bin/perl"); File usrLocalBin = new File("/usr/local/bin/perl"); if(usrBin.canExecute() && usrBin.exists() && !usrBin.isDirectory()){ PERL = "/usr/bin/perl"; }else if(usrLocalBin.canExecute() && usrLocalBin.exists() && !usrLocalBin.isDirectory()){ PERL = "/usr/local/bin/perl"; }else{ throw new FileNotFoundException("perl not found in your system"); } rrCmd.add(PERL); rrCmd.add(RR_PATH); rrFullCmd.add(PERL); rrFullCmd.add(RR_FULL_PATH); } }

Target:
ExtractRegistry() throws IngestModuleException { moduleName = NbBundle.getMessage(ExtractIE.class, "ExtractRegistry.moduleName.text"); final File rrRoot = InstalledFileLocator.getDefault().locate("rr", ExtractRegistry.class.getPackage().getName(), false); if (rrRoot == null) { throw new IngestModuleException(Bundle.RegRipperNotFound()); } final File rrFullRoot = InstalledFileLocator.getDefault().locate("rr-full", ExtractRegistry.class.getPackage().getName(), false); if (rrFullRoot == null) { throw new IngestModuleException(Bundle.RegRipperFullNotFound()); } String executableToRun = RIP_EXE; if (!PlatformUtil.isWindowsOS()) { executableToRun = RIP_PL; } rrHome = rrRoot.toPath(); RR_PATH = rrHome.resolve(executableToRun).toString(); rrFullHome = rrFullRoot.toPath(); RR_FULL_PATH = rrFullHome.resolve(executableToRun).toString(); if (!(new File(RR_PATH).exists())) { throw new IngestModuleException(Bundle.RegRipperNotFound()); } if (!(new File(RR_FULL_PATH).exists())) { throw new IngestModuleException(Bundle.RegRipperFullNotFound()); } if(PlatformUtil.isWindowsOS()){ rrCmd.add(RR_PATH); rrFullCmd.add(RR_FULL_PATH); }else{ String perl; File usrBin = new File("/usr/bin/perl"); File usrLocalBin = new File("/usr/local/bin/perl"); if(usrBin.canExecute() && usrBin.exists() && !usrBin.isDirectory()){ perl = "/usr/bin/perl"; }else if(usrLocalBin.canExecute() && usrLocalBin.exists() && !usrLocalBin.isDirectory()){ perl = "/usr/local/bin/perl"; }else{ throw new IngestModuleException("perl not found in your system"); } rrCmd.add(perl); rrCmd.add(RR_PATH); rrFullCmd.add(perl); rrFullCmd.add(RR_FULL_PATH); } }