final String executablePath = shortcutCreationDTO.getExecutable().getAbsolutePath(); final String pathInContainers = executablePath.replace(containersPath, ""); final String[] split = pathInContainers.split("/"); shortcutObject.callMember("description", shortcutCreationDTO.getDescription()); shortcutObject.callMember("miniature", shortcutCreationDTO.getMiniature()); shortcutObject.callMember("search", shortcutCreationDTO.getExecutable().getName()); shortcutObject.callMember("prefix", container); shortcutObject.callMember("create");