\r
import java.io.File;\r
import java.io.FileNotFoundException;\r
+import java.util.ArrayList;\r
import java.util.HashMap;\r
import java.util.List;\r
import java.util.Map;\r
return platformTemplateMap;\r
}\r
}\r
+ \r
+ public List<File> loadPlatformSamples(ProfileInfo profileInfo) {\r
+ File rootPath = getSampleRoot(profileInfo, profileInfo.getLatestPlatformVersion(), subDir);\r
+ try {\r
+ List<File> templates = FileUtil.findFiles(rootPath, fileName, true);\r
+ return templates;\r
+ } catch (FileNotFoundException e) {\r
+ logger.warn("Failed to load template from " + rootPath);\r
+ return new ArrayList<File>(0);\r
+ }\r
+ }\r
\r
public static void mapToPlatformName(String[] categories, ProfileInfo profileInfo) {\r
// We are using the flattened PlatformPathInfo, so we can use the latest path/version as its path/version.\r
}
ProfileInfo profileInfo = InstallPathConfig.getProfileInfo(profile);
- String path = profileInfo.getPlatformPath(version);
- if ( path == null ) {
- return null;
+ if ( profileInfo == null ) {
+ return new ProfileInfo(profile, version, null);
}
+ String path = profileInfo.getPlatformPath(version);
return new ProfileInfo(profile, version, path);
}