3 The file is used to init workspace
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 package org
.tianocore
.frameworkwizard
.workspace
;
20 import org
.tianocore
.frameworkwizard
.common
.DataType
;
22 public class Workspace
{
24 // Define class members
26 private static String currentWorkspace
= null;
28 private static String strWorkspaceDatabaseFile
= DataType
.FILE_SEPARATOR
+ "Tools" + DataType
.FILE_SEPARATOR
29 + "Conf" + DataType
.FILE_SEPARATOR
+ "FrameworkDatabase.db";
36 public static void main(String
[] args
) {
37 // TODO Auto-generated method stub
44 @return currentWorkspace
47 public static String
getCurrentWorkspace() {
48 return currentWorkspace
;
54 @param currentWorkspace
55 The input data of currentWorkspace
58 public static void setCurrentWorkspace(String currentWorkspace
) {
59 Workspace
.currentWorkspace
= currentWorkspace
;
63 Check if current workspace exists of not
65 @retval true - The current WORKSPACE exists
66 @retval false - The current WORKSPACE doesn't exist
69 public static boolean checkCurrentWorkspace() {
70 return checkWorkspace(getCurrentWorkspace());
74 Check if current workspace exists or not via input workspace path
77 The input data of WORKSPACE path
78 @retval true - The current WORKSPACE exists
79 @retval false - The current WORKSPACE doesn't exist
82 public static boolean checkWorkspace(String strWorkspace
) {
83 if (strWorkspace
== null || strWorkspace
== "") {
87 // Check workspace directory
89 File f
= new File(strWorkspace
);
90 if (!f
.isDirectory()) {
98 // Check FrameworkDatabase.db
100 f
= new File(strWorkspace
+ Workspace
.getStrWorkspaceDatabaseFile());
108 public static String
getStrWorkspaceDatabaseFile() {
109 return strWorkspaceDatabaseFile
;
112 public static void setStrWorkspaceDatabaseFile(String strWorkspaceDatabaseFile
) {
113 //Workspace.strWorkspaceDatabaseFile = strWorkspaceDatabaseFile;