public void service()

in taverna-tavlang-tool/src/main/java/org/apache/taverna/tavlang/tools/inspect/ServiceTypes.java [56:110]


	public void service() throws ReaderException, IOException{
		WorkflowBundleIO io = new WorkflowBundleIO();
		StringBuilder sb = new StringBuilder();
		
		for (String filepath : filesList) {
			File file = new File(filepath);
			
			if(file.isDirectory()){
				for(File f : file.listFiles()){
				WorkflowBundle wfBundle = io.readBundle(f, null);
				System.out.println("Service types used in " + f.getCanonicalPath() + " :" +"\n");
				sb.append("Service types used in " + f.getCanonicalPath() + " :");
				for (Profile profile : wfBundle.getProfiles()) {
					for (Activity activity : profile.getActivities()) {
						this.types.add(activity.getType().toASCIIString());
					}
				}
				for(String t : types){
					System.out.println(t);
					sb.append(t + "\n");
				}
				System.out.println("\n**************************************************\n");
				sb.append("\n**************************************************\n");
				}
			}else{
			// mediaType = null  --> guess
				WorkflowBundle wfBundle = io.readBundle(file, null);
				System.out.println("Service types used in " + file.getCanonicalPath() + " :" + "\n");
				sb.append("Service types used in " + file.getCanonicalPath() + " :");
				for (Profile profile : wfBundle.getProfiles()) {
					for (Activity activity : profile.getActivities()) {
						this.types.add(activity.getType().toASCIIString());
					}
				}
				for(String t : types){
					System.out.println(t);
					sb.append(t + "\n");
				}
				
				System.out.println("\n**************************************************\n");
				sb.append("\n**************************************************\n");
			}
		}
		
		if(save!=null){
			File log = new File(save);
			FileWriter fw = new FileWriter(log);
			BufferedWriter bw = new BufferedWriter(fw);
			bw.write(sb.toString());
			bw.close();
			fw.close();
			System.out.println("Results were saved into " + save);
		}
		
	}