public void setMetaDataLocations(List<VirtualFile> locations) { Map<VirtualFile, MetaDataType> locationsMap = null; if (locations != null) { locationsMap = new LinkedHashMap<VirtualFile, MetaDataType>(); for (VirtualFile file : locations) locationsMap.put(file, MetaDataType.DEFAULT); } setMetaDataLocationsMap(locationsMap); }
public void appendMetaDataLocation(VirtualFile... locations) { if (locations == null) throw new IllegalArgumentException("Null location"); Map<VirtualFile, MetaDataType> locationsMap = new LinkedHashMap<VirtualFile, MetaDataType>(); if (metaDataLocations != null) locationsMap.putAll(metaDataLocations); // add the old ones for (VirtualFile location : locations) { if (location == null) throw new IllegalArgumentException("Null virtual file in " + Arrays.toString(locations)); locationsMap.put(location, MetaDataType.DEFAULT); } setMetaDataLocationsMap(locationsMap); }
public void prependMetaDataLocation(VirtualFile... locations) { if (locations == null) throw new IllegalArgumentException("Null locations"); Map<VirtualFile, MetaDataType> locationsMap = new LinkedHashMap<VirtualFile, MetaDataType>(); for (int i = locations.length-1; i >= 0; --i) { VirtualFile location = locations[i]; if (location == null) throw new IllegalArgumentException("Null virtual file in " + Arrays.toString(locations)); locationsMap.put(location, MetaDataType.DEFAULT); } // add the old ones if (metaDataLocations != null) locationsMap.putAll(metaDataLocations); setMetaDataLocationsMap(locationsMap); }
public void setMetaDataPath(List<MetaDataEntry> paths) { if (paths == null) { setMetaDataLocations(null); return; } Map<VirtualFile, MetaDataType> locations = new LinkedHashMap<VirtualFile, MetaDataType>(); for (MetaDataEntry entry : paths) { if (entry == null) throw new IllegalArgumentException("Null entry in paths: " + paths); String path = entry.getPath(); VirtualFile child = root.getChild(path); if (child != null) locations.put(child, entry.getType()); else log.debugf("Meta data path does not exist: root=%1s path=%2s", root.getPathName(), path); } setMetaDataLocationsMap(locations); }