MigrateFromInstallDataStore.java revision fb379c70e3fd8a537f311b99be4759ae41e02750
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: MigrateFromInstallDataStore.java,v 1.2 2008/06/25 05:51:22 qcheng Exp $
*
*/
/**
* This class reads the install state file, belonging to previous product.
*
*/
/**
* get install state store, reading state file if install state store
* is null.
*
* @return InstallDataStore
* @throws InstallException thrown when reading state file fails.
*/
public static synchronized InstallDataStore getInstallDataStore()
throws InstallException {
"MigrateFromInstallDataStore.getInstallDataStore() -" +
" Error - state file:" + stateFileName +
" does not exist");
} else {
"MigrateFromInstallDataStore.getInstallDataStore() -" +
"loading an existing store. File: " +
try {
setIsExistingStore(true);
} catch (Exception e) {
"MigrateFromInstallDataStore.getInstallDataStore() - " +
"Error loading State information ", e);
throw new InstallException(LocalizedMessage
.get(LOC_IS_ERR_LOAD_INSTALL_STATE), e);
} finally {
try {
} catch (IOException ioe) {
// Ignore
}
}
}
}
}
return idStore;
}
/**
* check if install state store exists.
*
* @return true if install state store exists, false if it does not.
*/
public static boolean isExistingStore() {
return isExistingStore;
}
/**
* set if install state store exists.
*
* @param existingStore
*/
private static void setIsExistingStore(boolean existingStore) {
}
/**
* return product's home.
*
* @return the product home to migrate from
*/
private static String getProductHome() {
return productHome;
}
/**
* set product's home.
*
* @param oldProductHome the product home to migrate from
*/
}
private static String getInstallStateFile() {
return getProductHome() + STR_STATE_FILE_NAME;
}
private static final String STR_STATE_FILE_NAME =
private static transient boolean isExistingStore = false;
}