id
stringlengths
7
14
text
stringlengths
1
106k
832679_4
public String getName() { return module + (className != null ? "::" + className : ""); }
832679_5
@Override public String render(OsFamily arg0) { Boolean isHiera = config.getBoolean(PUPPET_HIERA_CLASSES, false); // when we get to the last role, let's cat all the manifests we made together inside a // node default site.pp Builder<Statement> statements = ImmutableList.<Statement> builder(); statements.add(Statements.rm(SITE_PP_FILE_LOCATION)); statements.add(Statements.rm(CONF_PP_FILE_LOCATION)); statements.add(Statements.rm(HIERA_COMMON_FILE_LOCATION)); Builder<String> sitePp = ImmutableList.<String> builder(); Map<String, Set<String>> puppetRoles = Maps.newHashMap(); for (Cluster.Instance instance : instances) { for (String role : instance.getRoles()) { int firstColon = role.indexOf(':'); if (firstColon != -1 && role.substring(0, firstColon).equals(PUPPET)) { String puppetClass = role.substring(firstColon + 1); if (!puppetRoles.containsKey(puppetClass)) { puppetRoles.put(puppetClass, Sets.<String>newHashSet()); } puppetRoles.get(puppetClass).add(instance.getPrivateIp()); } } } Builder<String> confPp = ImmutableList.<String> builder(); for (String puppetClass : puppetRoles.keySet()) { confPp.add(puppetClass + "," + Joiner.on(',').join(puppetRoles.get(puppetClass))); } Builder<String> confHiera = ImmutableList.<String> builder(); for (String puppetClass : puppetRoles.keySet()) { confHiera.add(puppetClass + ":\n - " + Joiner.on("\n - ").join(puppetRoles.get(puppetClass))); } sitePp.add("$extlookup_datadir='/etc/puppet/manifests/extdata'"); sitePp.add("$extlookup_precedence = ['common']"); sitePp.add("node default {"); for (String role : roles) { String manifestAttribPrefix = role.replaceAll(":+", "."); Configuration manifestProps = new PropertiesConfiguration(); for (@SuppressWarnings("unchecked") Iterator<String> it = config.getKeys(manifestAttribPrefix); it.hasNext();) { String key = it.next(); manifestProps.setProperty(key, config.getProperty(key)); } Manifest roleManifest = getManifestForClusterSpecAndRole(role, manifestProps); if (isHiera) { sitePp.add("include " + roleManifest.getName()); confHiera.add(roleManifest.getHiera()); } else { sitePp.add(roleManifest.toString()); } } sitePp.add("}"); if (isHiera) { Builder<String> confPuppetHiera = ImmutableList.<String> builder(); confPuppetHiera.add("---", ":backends:", " - yaml", ":yaml:", " :datadir: /etc/puppet/hieradata", ":hierarchy:", " - common"); statements.add(createOrOverwriteFile(HIERA_CONF_FILE_LOCATION, confPuppetHiera.build())); statements.add(exec("mkdir -p /etc/puppet/hieradata")); } statements.add(createOrOverwriteFile(HIERA_COMMON_FILE_LOCATION, confHiera.build())); statements.add(createOrOverwriteFile(CONF_PP_FILE_LOCATION, confPp.build())); statements.add(createOrOverwriteFile(SITE_PP_FILE_LOCATION, sitePp.build())); statements.add(exec("puppet apply " + SITE_PP_FILE_LOCATION)); return new StatementList(statements.build()).render(arg0); }
832679_6
@Override public String render(OsFamily arg0) { return exec( "git clone " + (vcsBranch != null ? "-b " + vcsBranch + " " : "") + url + " " + MODULES_DIR + module).render(arg0); }
832679_7
@Override public String render(OsFamily arg0) { return exec( "git clone " + (vcsBranch != null ? "-b " + vcsBranch + " " : "") + url + " " + MODULES_DIR + module).render(arg0); }
832679_8
@Override public Statement apply(Map<String, String> props) { try { return installModuleFromRemoteFileOrGit(find(props.keySet(), contains(MODULE_KEY_PATTERN)), props); } catch (NoSuchElementException e) { throw new IllegalArgumentException(format("couldn't find pattern: %s in properties %s", MODULE_KEY_PATTERN, props)); } }
832679_9
@Override public Statement apply(Map<String, String> props) { try { return installModuleFromRemoteFileOrGit(find(props.keySet(), contains(MODULE_KEY_PATTERN)), props); } catch (NoSuchElementException e) { throw new IllegalArgumentException(format("couldn't find pattern: %s in properties %s", MODULE_KEY_PATTERN, props)); } }
832680_0
public DefaultScanResult scan() { FileScanner scanner = new FileScanner( basedir, "class" ); List<String> result = new ArrayList<>(); scanner.scanTo( result, filter ); return new DefaultScanResult( result ); }
832680_1
@Nonnull public static String convertJarFileResourceToJavaClassName( @Nonnull String test ) { return StringUtils.removeEnd( test, ".class" ).replace( "/", "." ); }
832680_2
public static boolean isJavaClassFile( String file ) { return file.endsWith( ".class" ); }
832680_3
public static File replaceForkThreadsInPath( File path, int replacement ) { Deque<String> dirs = new LinkedList<>(); File root = path; while ( !root.exists() ) { dirs.addFirst( replaceThreadNumberPlaceholders( root.getName(), replacement ) ); root = root.getParentFile(); } File replacedPath = root; for ( String dir : dirs ) { replacedPath = new File( replacedPath, dir ); } return replacedPath; }
832680_4
public static File replaceForkThreadsInPath( File path, int replacement ) { Deque<String> dirs = new LinkedList<>(); File root = path; while ( !root.exists() ) { dirs.addFirst( replaceThreadNumberPlaceholders( root.getName(), replacement ) ); root = root.getParentFile(); } File replacedPath = root; for ( String dir : dirs ) { replacedPath = new File( replacedPath, dir ); } return replacedPath; }
832680_5
public static String[] getDumpFilesToPrint() { return DUMP_FILES_PRINT.clone(); }
832680_6
public static String[] getDumpFilesToPrint() { return DUMP_FILES_PRINT.clone(); }
832680_7
public static String escapeToPlatformPath( String path ) { if ( IS_OS_WINDOWS && path.length() > MAX_PATH_LENGTH_WINDOWS ) { path = path.startsWith( "\\\\" ) ? "\\\\?\\UNC\\" + path.substring( 2 ) : "\\\\?\\" + path; } return path; }
832680_8
public static void reportExecution( SurefireReportParameters reportParameters, RunResult result, PluginConsoleLogger log, Exception firstForkException ) throws MojoFailureException, MojoExecutionException { if ( firstForkException == null && !result.isTimeout() && result.isErrorFree() ) { if ( result.getCompletedCount() == 0 && failIfNoTests( reportParameters ) ) { throw new MojoFailureException( "No tests were executed! " + "(Set -DfailIfNoTests=false to ignore this error.)" ); } return; } if ( reportParameters.isTestFailureIgnore() ) { log.error( createErrorMessage( reportParameters, result, firstForkException ) ); } else { throwException( reportParameters, result, firstForkException ); } }
832680_9
public static void reportExecution( SurefireReportParameters reportParameters, RunResult result, PluginConsoleLogger log, Exception firstForkException ) throws MojoFailureException, MojoExecutionException { if ( firstForkException == null && !result.isTimeout() && result.isErrorFree() ) { if ( result.getCompletedCount() == 0 && failIfNoTests( reportParameters ) ) { throw new MojoFailureException( "No tests were executed! " + "(Set -DfailIfNoTests=false to ignore this error.)" ); } return; } if ( reportParameters.isTestFailureIgnore() ) { log.error( createErrorMessage( reportParameters, result, firstForkException ) ); } else { throwException( reportParameters, result, firstForkException ); } }
834344_0
public static String camelToUnderscore(final String input) { String result = input; if (input instanceof String) { result = input.replaceAll("([a-z])([A-Z])", "$1_$2").toLowerCase(); } return result; }
834344_1
public static String camelToUnderscore(final String input) { String result = input; if (input instanceof String) { result = input.replaceAll("([a-z])([A-Z])", "$1_$2").toLowerCase(); } return result; }
834344_2
public static String camelToUnderscore(final String input) { String result = input; if (input instanceof String) { result = input.replaceAll("([a-z])([A-Z])", "$1_$2").toLowerCase(); } return result; }
834344_3
public static String camelToUnderscore(final String input) { String result = input; if (input instanceof String) { result = input.replaceAll("([a-z])([A-Z])", "$1_$2").toLowerCase(); } return result; }
834344_4
public static String canonicalize(final String name) { String result = null; if (name != null) { result = name.toLowerCase().replace(' ', '-').replaceAll("[^a-z0-9-]*", "").replaceAll("-+", "-"); } return result; }
834344_5
public static String canonicalize(final String name) { String result = null; if (name != null) { result = name.toLowerCase().replace(' ', '-').replaceAll("[^a-z0-9-]*", "").replaceAll("-+", "-"); } return result; }
834344_6
public static String canonicalize(final String name) { String result = null; if (name != null) { result = name.toLowerCase().replace(' ', '-').replaceAll("[^a-z0-9-]*", "").replaceAll("-+", "-"); } return result; }
834344_7
public static boolean isAlphabetic(final String text) { if (text != null) { return text.matches("^[a-zA-Z]*$"); } return false; }
834344_8
public static boolean isAlphabetic(final String text) { if (text != null) { return text.matches("^[a-zA-Z]*$"); } return false; }
834344_9
public static boolean isAlphabetic(final String text) { if (text != null) { return text.matches("^[a-zA-Z]*$"); } return false; }
844592_0
public ExceptionHandlingStrategy makeExceptionHandlingStrategy( final Level logLevel, final PrintStream originalPrintStream) { return new LogPerLineExceptionHandlingStrategy(logLevel); }
844592_1
public ExceptionHandlingStrategy makeExceptionHandlingStrategy( final Level logLevel, final PrintStream originalPrintStream) { return new LogPerLineExceptionHandlingStrategy(logLevel); }
846296_0
public SourceTemplate(Writer writer, String className, List<BsonDocumentObjectElement> annotatedElements) { this.writer = writer; this.className = className; this.annotatedElements = annotatedElements; }
851175_0
public Dimension getDimensionX() { return getDimension(xDimIndex); }
851175_1
static boolean rasterDimMatches(Modis35DimKey rasterDim, String rasterDimNameString) { String[] rasterDimNames = rasterDimNameString.split(","); if (rasterDim.getRank() == rasterDimNames.length) { boolean dimsMatch = true; for (int j = 0; j < rasterDim.getRank(); j++) { if (!rasterDim.getDimension(j).getShortName().equals(rasterDimNames[j])) { dimsMatch = false; } } if (dimsMatch) { return true; } } return false; }
851175_2
@Override public ProductReader createReaderInstance() { return new MfgMSAProductReader(this); }
851175_3
static boolean mfgAlbedoFileNameMatches(String fileName) { if (!(fileName.matches("MSA_Albedo_L2.0_V[0-9].[0-9]{2}_[0-9]{3}_[0-9]{4}_[0-9]{3}_[0-9]{3}.(?i)(hdf)"))) { throw new IllegalArgumentException("Input file name '" + fileName + "' does not match naming convention: 'MSA_Albedo_L2.0_Vm.nn_sss_yyyy_fff_lll.HDF'"); } return true; }
851175_4
static boolean mfgAncillaryFileNameMatches(String fileName) { if (!(fileName.matches("MSA_Ancillary_L2.0_V[0-9].[0-9]{2}_[0-9]{3}_[0-9]{4}_[0-9]{3}_[0-9]{3}.(?i)(hdf)"))) { throw new IllegalArgumentException("Input file name '" + fileName + "' does not match naming convention: 'MSA_Ancillary_L2.0_Vm.nn_sss_yyyy_fff_lll.HDF'"); } return true; }
851175_5
static boolean mfgStaticInputFileNameMatches(String fileName) { if (!(fileName.matches("MSA_Static_L2.0_V[0-9].[0-9]{2}_[0-9]{3}_[0-9]{1}.(?i)(hdf)"))) { throw new IllegalArgumentException("Input file name '" + fileName + "' does not match naming convention: 'MSA_Static_L2.0_Vm.nn_sss_m.HDF'"); } return true; }
851175_6
@Override public void close() { if (extractDir != null) { FileUtils.deleteTree(extractDir); extractDir = null; } }
851175_7
@Override public void close() { if (extractDir != null) { FileUtils.deleteTree(extractDir); extractDir = null; } }
851175_8
@Override public void close() { if (extractDir != null) { FileUtils.deleteTree(extractDir); extractDir = null; } }
851175_9
@Override public void close() { if (extractDir != null) { FileUtils.deleteTree(extractDir); extractDir = null; } }
859322_0
public static byte[] execute(URL url, InputStream input, String encoding) throws IOException { byte[] bytes; try { StringBuilder sb = new StringBuilder(); UnicodeReader reader = new UnicodeReader(input, encoding); try { char[] cbuf = new char[32]; int r; while ((r = reader.read(cbuf, 0, 32)) != -1) { sb.append(cbuf, 0, r); } String str = sb.toString(); if (!str.contains("ui:component")) { try { String fileEncoding = reader.getEncoding(); InputSource is = new InputSource(new StringReader(str)); is.setEncoding(fileEncoding); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); XMLDocumentFilter[] filters = { new Writer(baos, fileEncoding) { protected void printStartElement(QName element, XMLAttributes attributes) { fPrinter.print('<'); fPrinter.print(element.rawname); int attrCount = attributes != null ? attributes.getLength() : 0; for (int i = 0; i < attrCount; i++) { String aname = attributes.getQName(i); String avalue = attributes.getValue(i); fPrinter.print(' '); fPrinter.print(aname); fPrinter.print("=\""); printAttributeValue(avalue); fPrinter.print('"'); } if (HTMLElements.getElement(element.rawname).isEmpty()) { fPrinter.print(' '); fPrinter.print('/'); } fPrinter.print('>'); fPrinter.flush(); } protected void printAttributeValue(String text) { fPrinter.print(StringEscapeUtils.escapeHtml(text)); fPrinter.flush(); } protected void printEntity(String name) { fPrinter.print('&'); fPrinter.print('#'); fPrinter.print(HTMLEntities.get(name)); fPrinter.print(';'); fPrinter.flush(); } }}; DOMParser parser = new DOMParser(); parser.setFeature("http://cyberneko.org/html/features/balance-tags", false); parser.setFeature("http://cyberneko.org/html/features/scanner/notify-builtin-refs", true); parser.setProperty("http://cyberneko.org/html/properties/default-encoding", fileEncoding); parser.setProperty("http://cyberneko.org/html/properties/names/elems", "lower"); parser.setProperty("http://cyberneko.org/html/properties/filters", filters); parser.parse(is); str = "<!DOCTYPE html>" + baos.toString(fileEncoding); } catch (Exception e) { logger.error(e.getMessage(), e); } if (url.getFile().contains("META-INF/templates")) { str = "<ui:component xmlns:ui=\"http://java.sun.com/jsf/facelets\">" + Pattern.compile("(<\\!DOCTYPE html>)|(</?html[^>]*>)|(<title>[^<]*</title>)", Pattern.CASE_INSENSITIVE).matcher(str).replaceAll("").replaceAll( "\\$\\{template\\.body\\}", "<ui:insert />") + "</ui:component>"; } } bytes = str.getBytes(reader.getEncoding()); } finally { reader.close(); } } catch (IOException e) { throw e; } return bytes; }
859322_1
public Object getProperty(String key) { return eppc.getProperty(key); }
860694_0
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // Complete the ZIP file IOUtils.closeQuietly(out); } }
860694_1
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // Complete the ZIP file IOUtils.closeQuietly(out); } }
860694_2
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // Complete the ZIP file IOUtils.closeQuietly(out); } }
860694_3
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // Complete the ZIP file IOUtils.closeQuietly(out); } }
860694_4
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // Complete the ZIP file IOUtils.closeQuietly(out); } }
860694_5
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // Complete the ZIP file IOUtils.closeQuietly(out); } }
860694_6
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // Complete the ZIP file IOUtils.closeQuietly(out); } }
860694_7
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // Complete the ZIP file IOUtils.closeQuietly(out); } }
860694_8
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // Complete the ZIP file IOUtils.closeQuietly(out); } }
860694_9
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // Complete the ZIP file IOUtils.closeQuietly(out); } }
860937_0
@Override public DoubleVector applyToElements(DoubleFunction func) { SparseDoubleVector newVec = new SparseDoubleVector(this.dimension, func.apply(this.defaultValue)); // apply function to all non-empty entries for (Map.Entry<Integer, Double> entry : this.elements.entrySet()) { newVec.elements.put(entry.getKey(), func.apply(entry.getValue())); } return newVec; }
860937_1
@Override public DoubleVector add(DoubleVector vector) { Preconditions.checkArgument(this.dimension == vector.getDimension(), "Dimensions of two vectors are not the same."); return this.addUnsafe(vector); }
860937_2
@Override public DoubleVector subtract(DoubleVector vector) { Preconditions.checkArgument(this.dimension == vector.getDimension(), "Dimensions of two vector are not the same."); return this.subtractUnsafe(vector); }
860937_3
@Override public DoubleVector multiply(double scalar) { final double val = scalar; return this.applyToElements(new DoubleFunction() { @Override public double apply(double value) { return val * value; } @Override public double applyDerivative(double value) { throw new UnsupportedOperationException(); } }); }
860937_4
@Override public DoubleVector divide(double scalar) { Preconditions.checkArgument(scalar != 0, "Scalar cannot be 0."); final double factor = scalar; return this.applyToElements(new DoubleFunction() { @Override public double apply(double value) { return value / factor; } @Override public double applyDerivative(double value) { throw new UnsupportedOperationException(); } }); }
860937_5
@Override public DoubleVector pow(int x) { final int p = x; return this.applyToElements(new DoubleFunction() { @Override public double apply(double value) { return Math.pow(value, p); } @Override public double applyDerivative(double value) { throw new UnsupportedOperationException(); } }); }
860937_6
@Override public DoubleVector abs() { return this.applyToElements(new DoubleFunction() { @Override public double apply(double value) { return Math.abs(value); } @Override public double applyDerivative(double value) { throw new UnsupportedOperationException(); } }); }
860937_7
@Override public DoubleVector sqrt() { return this.applyToElements(new DoubleFunction() { @Override public double apply(double value) { return Math.sqrt(value); } @Override public double applyDerivative(double value) { throw new UnsupportedOperationException(); } }); }
860937_8
@Override public double sum() { double sum = 0.0; Iterator<DoubleVectorElement> itr = this.iterate(); while (itr.hasNext()) { sum += itr.next().getValue(); } return sum; }
860937_9
@Override public double dot(DoubleVector vector) { Preconditions.checkArgument(this.dimension == vector.getDimension(), "Dimensions of two vectors are not equal."); return this.dotUnsafe(vector); }
862445_0
@Override public Iterator<Document> iterator() { if (inputStream != null) { throw new IllegalStateException("already fetched inputStream!"); } return new MultiXmlDocumentIterator(); }
870849_0
public static RuntimeException exceptionWithFriendlyMessageFor(Exception e) { Throwable cause = getRootCause(e); String message = cause.getMessage(); if (message == null) { message = cause.getClass().getSimpleName(); } if (cause instanceof JSchException) { message = "SSH: " + message; } return new RuntimeException(message, cause); }
870849_1
public int[] match(CharSequence filePath) { Matcher matcher = pattern.matcher(filePath); if (matcher.find()) { for (int i = 0; i < matchingLetters.length; ++i) { matchingLetters[i] = matcher.start(i + 1); } return matchingLetters; } else { return null; } }
870849_2
public int[] match(CharSequence filePath) { Matcher matcher = pattern.matcher(filePath); if (matcher.find()) { for (int i = 0; i < matchingLetters.length; ++i) { matchingLetters[i] = matcher.start(i + 1); } return matchingLetters; } else { return null; } }
870849_3
public int[] match(CharSequence filePath) { Matcher matcher = pattern.matcher(filePath); if (matcher.find()) { for (int i = 0; i < matchingLetters.length; ++i) { matchingLetters[i] = matcher.start(i + 1); } return matchingLetters; } else { return null; } }
870849_4
public List<TagSummary> getAll() { final RevWalk revWalk = new RevWalk(repository); List<TagSummary> tagSummaries = newArrayList(transform(repository.getTags().values(), new TagSummaryFactory(revWalk))); sort(tagSummaries, SORT_BY_TIME_AND_NAME); return tagSummaries; }
870849_5
public List<TagSummary> getAll() { final RevWalk revWalk = new RevWalk(repository); List<TagSummary> tagSummaries = newArrayList(transform(repository.getTags().values(), new TagSummaryFactory(revWalk))); sort(tagSummaries, SORT_BY_TIME_AND_NAME); return tagSummaries; }
870849_6
Intent cloneLauncherForWebBrowseIntent(Uri uri) { Matcher matcher = projectPathPattern.matcher(uri.getPath()); matcher.find(); return cloneLauncherIntentFor("git://github.com" + matcher.group() + ".git"); }
870849_7
Intent cloneLauncherForWebBrowseIntent(Uri uri) { Matcher matcher = projectPathPattern.matcher(uri.getPath()); matcher.find(); return cloneLauncherIntentFor("git://github.com" + matcher.group() + ".git"); }
876766_0
@Override public void execute() throws MojoExecutionException, MojoFailureException { client = new DefaultHttpClient(); if (hasProxy()) { enableAxisProxy(); configureHttpClientProxy(); } initializeConfluenceTemplate(); boolean isVersion30AndAbove = isConfluenceVersion30andAbove(); try { confluenceTemplate.export(client, exportSpaces, isVersion30AndAbove, this.outputDirectory); } catch (RemoteException e) { throw new MojoExecutionException(e.getMessage(), e); } catch (IOException e) { throw new MojoExecutionException(e.getMessage() , e); } catch (ServiceException e) { throw new MojoExecutionException(e.getMessage() , e.getLinkedCause()); } catch (HttpException e){ throw new MojoExecutionException(e.getMessage() , e); } finally{ client.getConnectionManager().shutdown(); } }
876766_1
@Override public void execute() throws MojoExecutionException, MojoFailureException { client = new DefaultHttpClient(); if (hasProxy()) { enableAxisProxy(); configureHttpClientProxy(); } initializeConfluenceTemplate(); boolean isVersion30AndAbove = isConfluenceVersion30andAbove(); try { confluenceTemplate.export(client, exportSpaces, isVersion30AndAbove, this.outputDirectory); } catch (RemoteException e) { throw new MojoExecutionException(e.getMessage(), e); } catch (IOException e) { throw new MojoExecutionException(e.getMessage() , e); } catch (ServiceException e) { throw new MojoExecutionException(e.getMessage() , e.getLinkedCause()); } catch (HttpException e){ throw new MojoExecutionException(e.getMessage() , e); } finally{ client.getConnectionManager().shutdown(); } }
876766_2
@Override public void execute() throws MojoExecutionException, MojoFailureException { client = new DefaultHttpClient(); if (hasProxy()) { enableAxisProxy(); configureHttpClientProxy(); } initializeConfluenceTemplate(); boolean isVersion30AndAbove = isConfluenceVersion30andAbove(); try { confluenceTemplate.export(client, exportSpaces, isVersion30AndAbove, this.outputDirectory); } catch (RemoteException e) { throw new MojoExecutionException(e.getMessage(), e); } catch (IOException e) { throw new MojoExecutionException(e.getMessage() , e); } catch (ServiceException e) { throw new MojoExecutionException(e.getMessage() , e.getLinkedCause()); } catch (HttpException e){ throw new MojoExecutionException(e.getMessage() , e); } finally{ client.getConnectionManager().shutdown(); } }
884758_0
public static GrizzlyExecutorService createInstance() { return createInstance(ThreadPoolConfig.DEFAULT); }
88960_10
public void setOptions(Map<String, String> options) { this.options.clear(); this.options.putAll(options); }
88960_11
@VisibleForTesting Map<String, String> getOptions() { return options; }
88960_12
public void setFile(File file) { this.file = file; }
88960_13
public void setFile(File file) { this.file = file; }
88960_14
public void setFile(File file) { this.file = file; }
88960_15
public void setFile(File file) { this.file = file; }
88960_16
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_17
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_18
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_19
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_20
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_21
public String getEdition() { return (String) lintFunc.get("edition", lintFunc); }
88960_22
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_23
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_24
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_25
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_26
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_27
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_28
public String report(String javaScript) { return report(javaScript, false); }
88960_29
public String report(String javaScript) { return report(javaScript, false); }
88960_30
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_31
public void resetOptions() { options.clear(); }
88960_32
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_33
public String format(JSLintResult result) { StringBuilder sb = new StringBuilder("<file"); sb.append(attr("name", result.getName())); sb.append(">" + NEWLINE); List<Issue> issues = result.getIssues(); for (Issue issue : issues) { sb.append("<issue"); sb.append(attr("line", Integer.toString(issue.getLine()))); sb.append(attr("char", Integer.toString(issue.getCharacter()))); sb.append(attr("reason", issue.getReason())); sb.append(attr("evidence", issue.getEvidence())); sb.append("/>" + NEWLINE); } sb.append("</file>"); return sb.toString(); }
88960_34
public String format(JSLintResult result) { StringBuilder sb = new StringBuilder("<file"); sb.append(attr("name", result.getName())); sb.append(">" + NEWLINE); List<Issue> issues = result.getIssues(); for (Issue issue : issues) { sb.append("<issue"); sb.append(attr("line", Integer.toString(issue.getLine()))); sb.append(attr("char", Integer.toString(issue.getCharacter()))); sb.append(attr("reason", issue.getReason())); sb.append(attr("evidence", issue.getEvidence())); sb.append("/>" + NEWLINE); } sb.append("</file>"); return sb.toString(); }
88960_35
public String format(JSLintResult result) { StringBuilder sb = new StringBuilder("<file"); sb.append(attr("name", result.getName())); sb.append(">\n"); for (Issue issue : result.getIssues()) { sb.append("<error"); sb.append(attr("line", Integer.toString(issue.getLine()))); sb.append(attr("column", Integer.toString(issue.getCharacter()))); // Based on com.puppycrawl.tools.checkstyle.api.SeverityLevel. sb.append(attr("severity", "warning")); sb.append(attr("message", issue.getReason())); sb.append(attr("source", JSLint.class.getName())); sb.append("/>\n"); } sb.append("</file>"); return sb.toString(); }