/** * Creates a DataEntryWriter that can write to the given class path entries. * * @param classPath the output class path. * @param fromIndex the start index in the class path. * @param toIndex the end index in the class path. * @return a DataEntryWriter for writing to the given class path entries. */ public DataEntryWriter createDataEntryWriter(ClassPath classPath, int fromIndex, int toIndex) { DataEntryWriter writer = null; // Create a chain of writers, one for each class path entry. for (int index = toIndex - 1; index >= fromIndex; index--) { ClassPathEntry entry = classPath.get(index); writer = createClassPathEntryWriter(entry, writer); } return writer; }
/** * Creates a DataEntryWriter that can write to the given class path entries. * * @param classPath the output class path. * @param fromIndex the start index in the class path. * @param toIndex the end index in the class path. * @return a DataEntryWriter for writing to the given class path entries. */ public DataEntryWriter createDataEntryWriter(ClassPath classPath, int fromIndex, int toIndex) { DataEntryWriter writer = null; // Create a chain of writers, one for each class path entry. for (int index = toIndex - 1; index >= fromIndex; index--) { ClassPathEntry entry = classPath.get(index); writer = createClassPathEntryWriter(entry, writer); } return writer; }
/** * Creates a DataEntryWriter that can write to the given class path entries. * * @param classPath the output class path. * @param fromIndex the start index in the class path. * @param toIndex the end index in the class path. * @return a DataEntryWriter for writing to the given class path entries. */ public static DataEntryWriter createDataEntryWriter(ClassPath classPath, int fromIndex, int toIndex) { DataEntryWriter writer = null; // Create a chain of writers, one for each class path entry. for (int index = toIndex - 1; index >= fromIndex; index--) { ClassPathEntry entry = classPath.get(index); writer = createClassPathEntryWriter(entry, writer); } return writer; }
/** * Creates a DataEntryWriter that can write to the given class path entries. * * @param classPath the output class path. * @param fromIndex the start index in the class path. * @param toIndex the end index in the class path. * @return a DataEntryWriter for writing to the given class path entries. */ public DataEntryWriter createDataEntryWriter(ClassPath classPath, int fromIndex, int toIndex) { DataEntryWriter writer = null; // Create a chain of writers, one for each class path entry. for (int index = toIndex - 1; index >= fromIndex; index--) { ClassPathEntry entry = classPath.get(index); writer = createClassPathEntryWriter(entry, writer); } return writer; }
/** * Reads all input entries from the given section of the given class path. */ public void readInput(String messagePrefix, ClassPath classPath, int fromIndex, int toIndex, DataEntryReader reader) throws IOException { for (int index = fromIndex; index < toIndex; index++) { ClassPathEntry entry = classPath.get(index); if (!entry.isOutput()) { readInput(messagePrefix, entry, reader); } } }
/** * Reads all input entries from the given section of the given class path. */ public void readInput(String messagePrefix, ClassPath classPath, int fromIndex, int toIndex, DataEntryReader reader) throws IOException { for (int index = fromIndex; index < toIndex; index++) { ClassPathEntry entry = classPath.get(index); if (!entry.isOutput()) { readInput(messagePrefix, entry, reader); } } }
/** * Reads all input entries from the given section of the given class path. */ public void readInput(String messagePrefix, ClassPath classPath, int fromIndex, int toIndex, DataEntryReader reader) throws IOException { for (int index = fromIndex; index < toIndex; index++) { ClassPathEntry entry = classPath.get(index); if (!entry.isOutput()) { readInput(messagePrefix, entry, reader); } } }
/** * Reads all input entries from the given section of the given class path. */ public void readInput(String messagePrefix, ClassPath classPath, int fromIndex, int toIndex, DataEntryReader reader) throws IOException { for (int index = fromIndex; index < toIndex; index++) { ClassPathEntry entry = classPath.get(index); if (!entry.isOutput()) { readInput(messagePrefix, entry, reader); } } }
/** * Sets the ClassPath to be represented in this panel. */ public void setClassPath(ClassPath classPath) { listModel.clear(); if (classPath != null) { for (int index = 0; index < classPath.size(); index++) { listModel.addElement(classPath.get(index)); } } // Make sure the selection buttons are properly enabled, // since the clear method doesn't seem to notify the listener. enableSelectionButtons(); }
/** * Performs some sanity checks on the class paths. */ private void checkInputOutput(ClassPath inputClassPath, ClassPath outputClassPath) throws IOException { if (inputClassPath == null || outputClassPath == null) { return; } for (int index1 = 0; index1 < inputClassPath.size(); index1++) { ClassPathEntry entry1 = inputClassPath.get(index1); if (!entry1.isOutput()) { for (int index2 = 0; index2 < outputClassPath.size(); index2++) { ClassPathEntry entry2 = outputClassPath.get(index2); if (entry2.isOutput() && entry2.getName().equals(entry1.getName())) { throw new IOException("Input jars and output jars must be different ["+entry1.getName()+"]"); } } } } }
private void writeJarOptions(String inputEntryOptionName, String outputEntryOptionName, ClassPath classPath) { if (classPath != null) { for (int index = 0; index < classPath.size(); index++) { ClassPathEntry entry = classPath.get(index); String optionName = entry.isOutput() ? outputEntryOptionName : inputEntryOptionName; writer.print(optionName); writer.print(' '); writer.print(relativeFileName(entry.getFile())); // Append the filters, if any. boolean filtered = false; filtered = writeFilter(filtered, entry.getZipFilter()); filtered = writeFilter(filtered, entry.getEarFilter()); filtered = writeFilter(filtered, entry.getWarFilter()); filtered = writeFilter(filtered, entry.getJarFilter()); filtered = writeFilter(filtered, entry.getFilter()); if (filtered) { writer.print(ConfigurationConstants.CLOSE_ARGUMENTS_KEYWORD); } writer.println(); } } }
ClassPathEntry entry = classPath.get(index); String optionName = entry.isOutput() ? outputEntryOptionName :
ClassPathEntry entry = classPath.get(index); String optionName = entry.isOutput() ? outputEntryOptionName :
ClassPathEntry entry = classPath.get(index); String optionName = entry.isOutput() ? outputEntryOptionName :