private RemoteFile createPathAwareRemoteFile(RemoteFile remoteFile) throws StorageException { PathAwareRemoteFileAttributes pathAwareRemoteFileAttributes = new PathAwareRemoteFileAttributes(); remoteFile.setAttributes(pathAwareRemoteFileAttributes); if (isFolderizable(remoteFile.getClass())) { // If remote file is folderizable, i.e. an 'affected file', // get the sub-path for it String subPathId = getSubPathId(remoteFile); String subPath = getSubPath(subPathId); pathAwareRemoteFileAttributes.setPath(subPath); } return remoteFile; }