CreateAGZip.java revision 4a2f0f0be43dfd4c1b490cbf3cc48b6ba6084b1c
/**
* 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: CreateAGZip.java,v 1.2 2008/08/20 21:39:26 qcheng Exp $
*
*/
/**
* * Creates Assertion Generator.
* */
public class CreateAGZip {
private Map fedConfigTagSwap;
private List fedConfigTagSwapOrder;
private Map fedletBits;
private Map jarExtracts;
/**
* Default constructor
*/
public CreateAGZip() {
fedConfigTagSwap = new HashMap();
"com.sun.identity.plugin.configuration.impl.FedletConfigurationImpl");
"com.sun.identity.plugin.datastore.impl.FedletDataStoreProvider");
"com.sun.identity.plugin.log.impl.FedletLogger");
"com.sun.identity.plugin.session.impl.FedletSessionProvider");
"com.sun.identity.saml.xmlsig.AMSignatureProvider");
"com.sun.identity.saml.xmlsig.JKSKeyProvider");
"com.sun.identity.common.serverMode=false");
fedConfigTagSwapOrder = new ArrayList();
}
throws IOException, FileNotFoundException {
}
// create fedlet.war
// copy README file
// create Fedlet ZIP
}
throws FileNotFoundException, IOException {
fedletBits = new HashMap();
}
}
throws IOException {
}
}
}
throws IOException {
try {
}
outFile);
if (size > 0) {
boolean bExtract = false;
) {
}
if (bExtract) {
byte[] b = new byte[size];
while (true) {
int readSize =
break;
} else {
}
}
zipOutputStream.write(b);
}
}
}
} finally {
try {
}
if (zipOutputStream != null) {
}
} catch (IOException ex) {
//ignore
}
}
}
}
throws IOException {
}
try {
int length = 0;
byte[] bytes = new byte[1024];
}
} else {
}
} finally {
try {
}
}
} catch (IOException ex) {
//ignore
}
}
}
"cot-name=fedletcot\n" +
"sun-fm-cot-status=Active\n" +
"sun-fm-trusted-providers=IDP_ENTITY_ID, FEDLET_ENTITY_ID\n" +
"sun-fm-saml2-readerservice-url=\n" +
"sun-fm-saml2-writerservice-url=\n";
}
throws IOException {
if (!isFileExists(bitsFile)) {
}
if (!isFileExists(jarExtractFile)) {
}
if (!isDirExists(warDir)) {
}
if (isFileExists(fedletZipFile)) {
" already exists");
}
if (!isFileExists(readmeFile)) {
}
}
}
}
} else {
return true;
}
} else {
return false;
}
}
private void createFederationConfigProperties(
byte[] content = new byte[1000];
int lenRead;
while (true) {
if (lenRead == -1) {
break;
}
}
}
prop);
}
throws IOException {
try {
} finally {
try {
//No handling requried
}
}
}
}
throws IOException {
try {
byte[] buf = new byte[1024];
int len;
}
out.closeEntry();
}
} finally {
try {
}
} catch (IOException ex) {
// ignore
}
}
}
throws IOException {
try {
byte[] buf = new byte[1024];
int len;
}
// Complete the entry
out.closeEntry();
}
return zipName;
} finally {
try {
}
} catch (IOException ex) {
// ignore
}
}
}
}
if (test.isDirectory()) {
}
}
}
if (f.isDirectory()) {
if (!bFileOnly) {
}
} else {
}
}
return list;
}
/**
* Main program to create Assertion Generator ZIP
* The program takes following parameters in order:
* 1. a file containing the list of filenames to be extract from opensso.war
* 2. a file containing the list of jars to be extracted
* 3. file point to the opensso.war
* 4. name with full path to write Assertion Generator ZIP
* 5. README file
*/
"<bits_filename> <jar_extract_filename> <war_directory> " +
"<assertion_generation_zip_filename> <readme_filename>");
}
try {
args[4]);
} catch (Exception e) {
e.printStackTrace();
}
}
}