throw exception if project directory or config file does not exist
This commit is contained in:
parent
8e1de297d5
commit
226a41abbf
|
@ -26,7 +26,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ProjectConfig.java,v 1.3 2008/10/03 10:23:33 fros4943 Exp $
|
||||
* $Id: ProjectConfig.java,v 1.4 2009/10/28 12:05:43 fros4943 Exp $
|
||||
*/
|
||||
|
||||
package se.sics.cooja;
|
||||
|
@ -135,15 +135,19 @@ public class ProjectConfig {
|
|||
*/
|
||||
public boolean appendProjectDir(File projectDir)
|
||||
throws FileNotFoundException, IOException {
|
||||
myProjectDirHistory.add(projectDir);
|
||||
|
||||
File projectConfig = new File(projectDir.getPath(),
|
||||
GUI.PROJECT_CONFIG_FILENAME);
|
||||
if (projectConfig.exists()) {
|
||||
return appendConfigFile(projectConfig);
|
||||
if (projectDir == null) {
|
||||
throw new FileNotFoundException("No project directory specified");
|
||||
}
|
||||
|
||||
return true;
|
||||
if (!projectDir.exists()) {
|
||||
throw new FileNotFoundException("Project directory does not exist: " + projectDir.getAbsolutePath());
|
||||
}
|
||||
|
||||
File projectConfig = new File(projectDir.getPath(), GUI.PROJECT_CONFIG_FILENAME);
|
||||
if (!projectConfig.exists()) {
|
||||
throw new FileNotFoundException("Project config does not exist: " + projectConfig.getAbsolutePath());
|
||||
}
|
||||
myProjectDirHistory.add(projectDir);
|
||||
return appendConfigFile(projectConfig);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue