public String getModuleName() { return FileUtils.getBaseName(workbook); }
public String getModuleName() { return FileUtils.getBaseName(workbook); }
public List<SelectItem> getWorkbooks() { List<SelectItem> items = new ArrayList<SelectItem>(workbooks.size()); for (String wbURI : workbooks.keySet()) { items.add(new SelectItem(wbURI, FileUtils.getBaseName(wbURI))); } return items; }
public List<SelectItem> getWorkbooks() { List<SelectItem> items = new ArrayList<SelectItem>(workbooks.size()); for (String wbURI : workbooks.keySet()) { items.add(new SelectItem(wbURI, FileUtils.getBaseName(wbURI))); } return items; }
private void print(ITracerObject tracer, int level, Writer writer) throws IOException { Iterable<ITracerObject> tracerObjects = tracer.getChildren(); for (ITracerObject aTrace : tracerObjects) { writer.write(indents, 0, level % indents.length); writer.write("TRACE: "); writer.write(TraceFormatter.getDisplayName(aTrace)); writer.write('\n'); writer.write(indents, 0, level % indents.length); writer.write(SourceCodeURLConstants.AT_PREFIX); writer.write(FileUtils.getBaseName(aTrace.getUri())); writer.write('&'); writer.write(SourceCodeURLConstants.OPENL); writer.write('='); writer.write('\n'); print(aTrace, level + 1, writer); } } }
private void deployJarForJboss(URL resourceURL) throws Exception { // This reflection implementation for JBoss vfs URLConnection conn = resourceURL.openConnection(); Object content = conn.getContent(); Class<?> clazz = content.getClass(); if ("org.jboss.vfs.VirtualFile".equals(clazz.getName())) { String urlString = resourceURL.toString(); urlString = urlString.substring(0, urlString.lastIndexOf(".jar") + 4); Object jarFile = new URL(urlString).openConnection().getContent(); Method getNameMethod = clazz.getMethod("getName"); String jarName = (String) getNameMethod.invoke(jarFile); Method getPhysicalFileMethod = clazz.getMethod("getPhysicalFile"); File contentsFile = (File) getPhysicalFileMethod.invoke(jarFile); File dir = contentsFile.getParentFile(); File physicalFile = new File(dir, jarName); rulesDeployerService.deploy(FileUtils.getBaseName(jarName), new FileInputStream(physicalFile), false); } else { throw new RuleServiceRuntimeException( "Protocol VFS supports only for JBoss VFS. URL content must be org.jboss.vfs.VirtualFile!"); } }
private void print(ITracerObject tracer, int level, Writer writer) throws IOException { Iterable<ITracerObject> tracerObjects = tracer.getChildren(); for (ITracerObject aTrace : tracerObjects) { writer.write(indents, 0, level % indents.length); writer.write("TRACE: "); writer.write(TraceFormatter.getDisplayName(aTrace)); writer.write('\n'); writer.write(indents, 0, level % indents.length); writer.write(SourceCodeURLConstants.AT_PREFIX); writer.write(FileUtils.getBaseName(aTrace.getUri())); writer.write('&'); writer.write(SourceCodeURLConstants.OPENL); writer.write('='); writer.write('\n'); print(aTrace, level + 1, writer); } } }
private void deployJarForJboss(URL resourceURL) throws Exception { // This reflection implementation for JBoss vfs URLConnection conn = resourceURL.openConnection(); Object content = conn.getContent(); Class<?> clazz = content.getClass(); if ("org.jboss.vfs.VirtualFile".equals(clazz.getName())) { String urlString = resourceURL.toString(); urlString = urlString.substring(0, urlString.lastIndexOf(".jar") + 4); Object jarFile = new URL(urlString).openConnection().getContent(); Method getNameMethod = clazz.getMethod("getName"); String jarName = (String) getNameMethod.invoke(jarFile); Method getPhysicalFileMethod = clazz.getMethod("getPhysicalFile"); File contentsFile = (File) getPhysicalFileMethod.invoke(jarFile); File dir = contentsFile.getParentFile(); File physicalFile = new File(dir, jarName); rulesDeployerService.deploy(FileUtils.getBaseName(jarName), new FileInputStream(physicalFile), false); } else { throw new RuleServiceRuntimeException( "Protocol VFS supports only for JBoss VFS. URL content must be org.jboss.vfs.VirtualFile!"); } }
rulesDeployerService.deploy(FileUtils.getBaseName(file.getName()), new FileInputStream(file), false);
rulesDeployerService.deploy(FileUtils.getBaseName(file.getName()), new FileInputStream(file), false);
String folderName = FileUtils.getBaseName(name); if (isSupportDeploymentVersion()) { folderName = folderName + getDeploymentVersionSuffix(); newProjectDir = new File(d, FileUtils.getBaseName(name)); newProjectDir.mkdirs(); }else{
@Override void execute(String sourcePath, boolean hasDependencies) throws Exception { if (StringUtils.isEmpty(deployServer)) { throw new IllegalArgumentException("The deploy server name cannot be empty"); } if (StringUtils.isEmpty(deployUrl)) { throw new IllegalArgumentException("The deploy server url cannot be empty"); } File zipFile = findZipFile(); Server server = settings.getServer(deployServer); if (server == null) { throw new IllegalStateException("The server configuration with name " + deployServer + " doesn't exist"); } Properties properties = new Properties(); if ("jdbc".equals(deployType)) { properties.put("production-repository.factory", "org.openl.rules.repository.db.JdbcDBRepositoryFactory"); } properties.put("production-repository.uri", deployUrl); properties.put("production-repository.login", server.getUsername()); properties.put("production-repository.password", server.getPassword()); properties.put("production-repository.deployments.path", "deploy/"); try (RulesDeployerService deployerService = new RulesDeployerService(properties)) { deployerService.deploy(FileUtils.getBaseName(zipFile.getName()), new FileInputStream(zipFile), false); } }
String folderName = FileUtils.getBaseName(name); if (isSupportDeploymentVersion()) { folderName = folderName + getDeploymentVersionSuffix(); newProjectDir = new File(d, FileUtils.getBaseName(name)); newProjectDir.mkdirs(); }else{
@Override void execute(String sourcePath, boolean hasDependencies) throws Exception { if (StringUtils.isEmpty(deployServer)) { throw new IllegalArgumentException("The deploy server name cannot be empty"); } if (StringUtils.isEmpty(deployUrl)) { throw new IllegalArgumentException("The deploy server url cannot be empty"); } File zipFile = findZipFile(); Server server = settings.getServer(deployServer); if (server == null) { throw new IllegalStateException("The server configuration with name " + deployServer + " doesn't exist"); } Properties properties = new Properties(); if ("jdbc".equals(deployType)) { properties.put("production-repository.factory", "org.openl.rules.repository.db.JdbcDBRepositoryFactory"); } properties.put("production-repository.uri", deployUrl); properties.put("production-repository.login", server.getUsername()); properties.put("production-repository.password", server.getPassword()); try (RulesDeployerService deployerService = new RulesDeployerService(properties)) { deployerService.deploy(FileUtils.getBaseName(zipFile.getName()), new FileInputStream(zipFile), false); } }
public static String extractFileNameFromModule(Module module) { if (module.getRulesRootPath() == null) { return module.getName(); } String path = module.getRulesRootPath().getPath(); return FileUtils.getBaseName(path); } }
public static String extractFileNameFromModule(Module module) { if (module.getRulesRootPath() == null) { return module.getName(); } String path = module.getRulesRootPath().getPath(); return FileUtils.getBaseName(path); } }
public List<Module> getAllModulesMatchingPathPattern(ProjectDescriptor descriptor, Module module, String pathPattern) throws IOException{ List<Module> modules = new ArrayList<Module>(); List<File> files = new ArrayList<File>(); check(descriptor.getProjectFolder(), files, pathPattern.trim(), descriptor.getProjectFolder()); for (File file : files) { Module m = new Module(); m.setProject(descriptor); m.setRulesRootPath(new PathEntry(file.getCanonicalPath())); m.setName(FileUtils.getBaseName(file.getName())); m.setMethodFilter(module.getMethodFilter()); m.setWildcardRulesRootPath(pathPattern); m.setWildcardName(module.getName()); m.setExtension(module.getExtension()); modules.add(m); } return modules; }
public List<Module> getAllModulesMatchingPathPattern(ProjectDescriptor descriptor, Module module, String pathPattern) throws IOException{ List<Module> modules = new ArrayList<Module>(); List<File> files = new ArrayList<File>(); check(descriptor.getProjectFolder(), files, pathPattern.trim(), descriptor.getProjectFolder()); for (File file : files) { Module m = new Module(); m.setProject(descriptor); m.setRulesRootPath(new PathEntry(file.getCanonicalPath())); m.setName(FileUtils.getBaseName(file.getName())); m.setMethodFilter(module.getMethodFilter()); m.setWildcardRulesRootPath(pathPattern); m.setWildcardName(module.getName()); m.setExtension(module.getExtension()); modules.add(m); } return modules; }
task.setDisplayName(FileUtils.getBaseName(task.getSrcFile()));
task.setDisplayName(FileUtils.getBaseName(task.getSrcFile()));