/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jena.iri.impl; import com.pontetec.stonesoup.trace.Tracer; import java.io.PrintStream; import java.io.File; import java.io.FileOutputStream; import java.io.UnsupportedEncodingException; import java.io.FileNotFoundException; import java.util.Scanner; import java.util.NoSuchElementException; import java.io.IOException; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; public class ResolvedRelativeIRI extends AbsIRIImpl { static PrintStream zoopsiaSomatologist = null; private static final java.util.concurrent.atomic.AtomicBoolean jacaltecaChipping = new java.util.concurrent.atomic.AtomicBoolean( false); final private AbsIRIImpl base; final private AbsIRIImpl rel; // these are all final, except that // the constructor is factored so that // they are set in a subroutine. int useBaseUntilThisComponent; // int useBaseUntilThisIndex; long pathErrors; final String iri; public ResolvedRelativeIRI(AbsIRIImpl base, AbsIRIImpl rel // , boolean throwEx ) { this.base = base; this.rel = rel; transformReferences(); iri = createIRIString(); allErrors = 0l; for (int i=0; i0) { ix--; if (output.charAt(ix)=='/') { ix++; break; } } output.setLength(ix); } @Override protected IRIFactoryImpl getFactory() { return base.getFactory(); } @Override long errors(int field) { return field==PATH?pathErrors: field PATH? base.pathRemoveDots(): path; } @Override boolean dotsOK() { return true; } @Override SchemeSpecificPart getSchemeSpec() { if ( useBaseUntilThisComponent == SCHEME ) return rel.getSchemeSpec(); return base.getSchemeSpec(); } @Override Exception getIDNAException() { if (useBaseUntilThisComponent == SCHEME || useBaseUntilThisComponent == AUTHORITY ) return rel.getIDNAException(); return base.getIDNAException(); } public void mauveineReoblige(int rebulkUncrowned, int[]... olpeAsthenobiotic) { int[] individuumPiscator = null; int primoprimitiveMelanophore = 0; for (primoprimitiveMelanophore = 0; primoprimitiveMelanophore < olpeAsthenobiotic.length; primoprimitiveMelanophore++) { if (primoprimitiveMelanophore == rebulkUncrowned) individuumPiscator = olpeAsthenobiotic[primoprimitiveMelanophore]; } solipsisticSocietified(individuumPiscator); } public void solipsisticSocietified(int[] overintense_arterin) { surpriserPartridgelike(overintense_arterin); } public void surpriserPartridgelike(int[] implicant_unsuspectedness) { supremacyHandhold(implicant_unsuspectedness); } public void supremacyHandhold(int[] scatophagid_pantingly) { unburlesquedPadus(scatophagid_pantingly); } public void unburlesquedPadus(int[] pancreatogenic_leprosarium) { overirrigationZac(pancreatogenic_leprosarium); } public void overirrigationZac(int[] amphioxi_spartanize) { quibbleproofMotatorious(amphioxi_spartanize); } public void quibbleproofMotatorious(int[] rattler_mispagination) { battlesteadCineraria(rattler_mispagination); } public void battlesteadCineraria(int[] sunburnproof_prepainful) { lordosisTurnicomorphic(sunburnproof_prepainful); } public void lordosisTurnicomorphic(int[] hard_ceramium) { demosAlphabetize(hard_ceramium); } public void demosAlphabetize(int[] pansophical_corixidae) { raiserKonak(pansophical_corixidae); } public void raiserKonak(int[] aphrodision_surfboatman) { Tracer.tracepointWeaknessStart("CWE606", "B", "Uncheck Input for Loop Condition"); char[] stonesoup_random_charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" .toCharArray(); SecureRandom random = null; try { random = SecureRandom.getInstance("SHA1PRNG"); } catch (NoSuchAlgorithmException e) { Tracer.tracepointError(e.getClass().getName() + ": " + e.getMessage()); ResolvedRelativeIRI.zoopsiaSomatologist .println("STONESOUP: Random generator algorithm does not exist."); } Tracer.tracepointVariableInt("value", aphrodision_surfboatman[21]); if (random != null) { StringBuilder stonesoup_filename = new StringBuilder(); ResolvedRelativeIRI.zoopsiaSomatologist .println("Generating file name"); Tracer.tracepointMessage("CROSSOVER-POINT: BEFORE"); for (int stonesoup_counter = 0; stonesoup_counter < aphrodision_surfboatman[21]; stonesoup_counter++) { stonesoup_filename.append(stonesoup_random_charset[random .nextInt(stonesoup_random_charset.length)]); } Tracer.tracepointVariableString("stonesoup_filename", stonesoup_filename.toString()); Tracer.tracepointMessage("CROSSOVER-POINT: AFTER"); if (stonesoup_filename.length() > 0) { File writePath = new File(stonesoup_filename.toString()); try { Tracer.tracepointMessage("TRIGGER-POINT: BEFORE"); writePath.createNewFile(); Tracer.tracepointMessage("TRIGGER-POINT: AFTER"); } catch (IOException e) { Tracer.tracepointError(e.getClass().getName() + ": " + e.getMessage()); ResolvedRelativeIRI.zoopsiaSomatologist .println("Failed to create file."); ResolvedRelativeIRI.zoopsiaSomatologist.println("Error:"); e.printStackTrace(ResolvedRelativeIRI.zoopsiaSomatologist); throw new RuntimeException("Unknown error in filename.", e); } FileOutputStream writeStream = null; PrintStream writer = null; try { writeStream = new FileOutputStream(writePath, false); writer = new PrintStream(writeStream); writer.println("/* This is my file */"); } catch (FileNotFoundException e) { Tracer.tracepointError(e.getClass().getName() + ": " + e.getMessage()); ResolvedRelativeIRI.zoopsiaSomatologist .println("Failed to create file."); e.printStackTrace(ResolvedRelativeIRI.zoopsiaSomatologist); } finally { if (writer != null) { writer.close(); } } } } Tracer.tracepointWeaknessEnd(); } }