public NamespaceAndDefinedLocalNamesForAngular(final Namespace namespace, final List<LocalNameForAngular> localNamesForAngular) { Objects.requireNonNull(namespace); Objects.requireNonNull(localNamesForAngular); this.id = namespace.getEncoded(); this.text = namespace.getDecoded(); this.localNamesForAngular = localNamesForAngular; }
public Collection<? extends DefinitionsChildId> getAllIdsInNamespace(Class<? extends DefinitionsChildId> clazz, Namespace namespace) { Collection<DefinitionsChildId> result = new HashSet<>(); String rootPathFragment = Util.getRootPathFragment(clazz); Path dir = this.repositoryRoot.resolve(rootPathFragment); dir = dir.resolve(namespace.getEncoded()); if (Files.exists(dir) && Files.isDirectory(dir)) { DirectoryStream<Path> directoryStream = null; try { directoryStream = Files.newDirectoryStream(dir); for (Path path : directoryStream) { Constructor<? extends DefinitionsChildId> constructor = null; constructor = clazz.getConstructor(String.class, String.class, boolean.class); DefinitionsChildId definitionsChildId = constructor.newInstance(namespace.getDecoded(), path.getFileName().toString(), false); result.add(definitionsChildId); } directoryStream.close(); } catch (IOException e) { FilebasedRepository.LOGGER.debug("Cannot close ds", e); } catch (NoSuchMethodException e) { FilebasedRepository.LOGGER.debug("Cannot find constructor", e); } catch (InstantiationException e) { FilebasedRepository.LOGGER.debug("Cannot instantiate object", e); } catch (IllegalAccessException e) { FilebasedRepository.LOGGER.debug("IllegalAccessException", e); } catch (InvocationTargetException e) { FilebasedRepository.LOGGER.debug("InvocationTargetException", e); } } return result; }
public void forceDelete(Class<? extends DefinitionsChildId> definitionsChildIdClazz, Namespace namespace) { // instantiate new definitions child id with "ID" as id // this is used to get the absolute path DefinitionsChildId id = BackendUtils.getDefinitionsChildId(definitionsChildIdClazz, namespace.getEncoded(), "ID", true); Path path = this.id2AbsolutePath(id); // do not delete the id, delete the complete namespace // patrent folder is the namespace folder path = path.getParent(); FileUtils.forceDelete(path); }
InputStream inputStream = repository.newInputStream(ref); Path path = this.path.resolve(id.getGroup()) .resolve(id.getNamespace().getEncoded()) .resolve(node.getIdFromIdOrNameField()) .resolve(ref.getFileName());
ServiceTemplateId serviceTemplate = (ServiceTemplateId) this.parent.getId(); location = location + "&ns="; location = location + serviceTemplate.getNamespace().getEncoded(); location = location + "&id="; location = location + serviceTemplate.getXmlId().getEncoded();
Path path = this.path.resolve(entry.getKey().getGroup()).resolve(entry.getKey().getNamespace().getEncoded()); try { Map<Path, TServiceTemplate> map = new X2YConverter(repository, this.path).convert(entry.getValue(), path, entry.getKey().getQName());
toInsert = tId.getNamespace().getEncoded(); if (doubleEncode) { toInsert = Util.URLencode(toInsert);
String res = "imports/"; res = res + Util.URLencode(i.getType()) + "/"; res = res + i.getNamespace().getEncoded() + "/"; res = res + i.getXmlId().getEncoded() + "/"; return res;
path = tcId.getNamespace().getEncoded() + "/" + tcId.getXmlId().getEncoded() + "/";