/** * Performance optimization, avoids URI manipulation. */ public String getDescriptorPathString(Device device) { return decodedPath + getDevicePath(device.getRoot()) + DESCRIPTOR_FILE; }
public URI prefixIfRelative(Device device, URI uri) { if (!uri.isAbsolute() && !uri.getPath().startsWith("/")) { return appendPathToBaseURI(getDevicePath(device) + "/" + uri); } return uri; }
public URI getPath(Device device) { return appendPathToBaseURI(getDevicePath(device)); }
protected String getServicePath(Service service) { if (service.getServiceId() == null) { throw new IllegalStateException("Can't generate local URI prefix without service ID"); } StringBuilder s = new StringBuilder(); s.append(SERVICE); s.append("/"); s.append(service.getServiceId().getNamespace()); s.append("/"); s.append(service.getServiceId().getId()); return getDevicePath(service.getDevice()) + s.toString(); } }
public URI getDescriptorPath(Device device) { return appendPathToBaseURI(getDevicePath(device.getRoot()) + DESCRIPTOR_FILE); }
public URI getIconPath(Icon icon) { return appendPathToBaseURI(getDevicePath(icon.getDevice()) + "/" + icon.getUri().toString()); }
public URI prefixIfRelative(Device device, URI uri) { if (!uri.isAbsolute() && !uri.getPath().startsWith("/")) { return appendPathToBaseURI(getDevicePath(device) + "/" + uri); } return uri; }
/** * Performance optimization, avoids URI manipulation. */ public String getDescriptorPathString(Device device) { return decodedPath + getDevicePath(device.getRoot()) + DESCRIPTOR_FILE; }
public URI getPath(Device device) { return appendPathToBaseURI(getDevicePath(device)); }
protected String getServicePath(Service service) { if (service.getServiceId() == null) { throw new IllegalStateException("Can't generate local URI prefix without service ID"); } StringBuilder s = new StringBuilder(); s.append(SERVICE); s.append("/"); s.append(service.getServiceId().getNamespace()); s.append("/"); s.append(service.getServiceId().getId()); return getDevicePath(service.getDevice()) + s.toString(); } }
public URI getDescriptorPath(Device device) { return appendPathToBaseURI(getDevicePath(device.getRoot()) + DESCRIPTOR_FILE); }
public URI getIconPath(Icon icon) { return appendPathToBaseURI(getDevicePath(icon.getDevice()) + "/" + icon.getUri().toString()); }