$search
00001 package org.best_of_robotics.transform.ros.to.cplusplus.tools; 00002 00003 import java.io.BufferedReader; 00004 import java.io.IOException; 00005 import java.io.InputStreamReader; 00006 00007 import org.eclipse.epsilon.eol.execute.context.Variable; 00008 import org.eclipse.epsilon.eol.tools.AbstractTool; 00009 00010 public class CHModTool extends AbstractTool { 00011 00012 protected String filename; 00013 protected String directory; 00014 00015 public void setName(String filename) { 00016 this.filename = filename; 00017 } 00018 00019 public String getFileName() { 00020 return filename; 00021 } 00022 00023 public void setDirectory(String directory) { 00024 this.directory = directory; 00025 } 00026 00027 public String getDirectory() { 00028 return directory; 00029 } 00030 00031 public void chmod(String rights) 00032 { 00033 try { 00034 Runtime.getRuntime().exec("chmod " + rights + " " + directory + "/cfg/" + filename + ".cfg"); 00035 } catch (IOException e) { 00036 e.printStackTrace(); 00037 } 00038 } 00039 00040 public void chmod2(String rights) 00041 { 00042 try { 00043 Runtime.getRuntime().exec("chmod " + rights + " " + directory + "/src/" + filename); 00044 } catch (IOException e) { 00045 e.printStackTrace(); 00046 } 00047 } 00048 00049 00050 }