1 /*******************************************************************************
2 * Copyright (c) 2010, 2014 Sonatype, Inc.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Sonatype, Inc. - initial API and implementation
10 *******************************************************************************/
11 package org
.eclipse
.aether
;
14 * The keys and defaults for common configuration properties.
16 * @see RepositorySystemSession#getConfigProperties()
18 public final class ConfigurationProperties
21 private static final String PREFIX_AETHER
= "aether.";
23 private static final String PREFIX_CONNECTOR
= PREFIX_AETHER
+ "connector.";
26 * The prefix for properties that control the priority of pluggable extensions like transporters. For example, for
27 * an extension with the fully qualified class name "org.eclipse.MyExtensionFactory", the configuration properties
28 * "aether.priority.org.eclipse.MyExtensionFactory", "aether.priority.MyExtensionFactory" and
29 * "aether.priority.MyExtension" will be consulted for the priority, in that order (obviously, the last key is only
30 * tried if the class name ends with "Factory"). The corresponding value is a float and the special value
31 * {@link Float#NaN} or "NaN" (case-sensitive) can be used to disable the extension.
33 public static final String PREFIX_PRIORITY
= PREFIX_AETHER
+ "priority.";
36 * A flag indicating whether the priorities of pluggable extensions are implicitly given by their iteration order
37 * such that the first extension has the highest priority. If set, an extension's built-in priority as well as any
38 * corresponding {@code aether.priority.*} configuration properties are ignored when searching for a suitable
39 * implementation among the available extensions. This priority mode is meant for cases where the application will
40 * present/inject extensions in the desired search order.
42 * @see #DEFAULT_IMPLICIT_PRIORITIES
44 public static final String IMPLICIT_PRIORITIES
= PREFIX_PRIORITY
+ "implicit";
47 * The default extension priority mode if {@link #IMPLICIT_PRIORITIES} isn't set.
49 public static final boolean DEFAULT_IMPLICIT_PRIORITIES
= false;
52 * A flag indicating whether interaction with the user is allowed.
54 * @see #DEFAULT_INTERACTIVE
56 public static final String INTERACTIVE
= PREFIX_AETHER
+ "interactive";
59 * The default interactive mode if {@link #INTERACTIVE} isn't set.
61 public static final boolean DEFAULT_INTERACTIVE
= false;
64 * The user agent that repository connectors should report to servers.
66 * @see #DEFAULT_USER_AGENT
68 public static final String USER_AGENT
= PREFIX_CONNECTOR
+ "userAgent";
71 * The default user agent to use if {@link #USER_AGENT} isn't set.
73 public static final String DEFAULT_USER_AGENT
= "Aether";
76 * The maximum amount of time (in milliseconds) to wait for a successful connection to a remote server. Non-positive
77 * values indicate no timeout.
79 * @see #DEFAULT_CONNECT_TIMEOUT
81 public static final String CONNECT_TIMEOUT
= PREFIX_CONNECTOR
+ "connectTimeout";
84 * The default connect timeout to use if {@link #CONNECT_TIMEOUT} isn't set.
86 public static final int DEFAULT_CONNECT_TIMEOUT
= 10 * 1000;
89 * The maximum amount of time (in milliseconds) to wait for remaining data to arrive from a remote server. Note that
90 * this timeout does not restrict the overall duration of a request, it only restricts the duration of inactivity
91 * between consecutive data packets. Non-positive values indicate no timeout.
93 * @see #DEFAULT_REQUEST_TIMEOUT
95 public static final String REQUEST_TIMEOUT
= PREFIX_CONNECTOR
+ "requestTimeout";
98 * The default request timeout to use if {@link #REQUEST_TIMEOUT} isn't set.
100 public static final int DEFAULT_REQUEST_TIMEOUT
= 1800 * 1000;
103 * The request headers to use for HTTP-based repository connectors. The headers are specified using a
104 * {@code Map<String, String>}, mapping a header name to its value. Besides this general key, clients may also
105 * specify headers for a specific remote repository by appending the suffix {@code .<repoId>} to this key when
106 * storing the headers map. The repository-specific headers map is supposed to be complete, i.e. is not merged with
107 * the general headers map.
109 public static final String HTTP_HEADERS
= PREFIX_CONNECTOR
+ "http.headers";
112 * The encoding/charset to use when exchanging credentials with HTTP servers. Besides this general key, clients may
113 * also specify the encoding for a specific remote repository by appending the suffix {@code .<repoId>} to this key
114 * when storing the charset name.
116 * @see #DEFAULT_HTTP_CREDENTIAL_ENCODING
118 public static final String HTTP_CREDENTIAL_ENCODING
= PREFIX_CONNECTOR
+ "http.credentialEncoding";
121 * The default encoding/charset to use if {@link #HTTP_CREDENTIAL_ENCODING} isn't set.
123 public static final String DEFAULT_HTTP_CREDENTIAL_ENCODING
= "ISO-8859-1";
126 * An option indicating whether authentication configured for a HTTP repository should also be used with any host
127 * that the original server might redirect requests to. Unless enabled, credentials are only exchanged with the
128 * original host from the repository URL and not supplied to different hosts encountered during redirects. The
129 * option value can either be a boolean flag or a comma-separated list of host names denoting the whitelist of
130 * original hosts whose redirects can be trusted and should use the configured authentication no matter the
131 * destination host(s). Alternatively, the suffix {@code .<repoId>} can be appended to this configuration key to
132 * control the behavior for a specific repository id.
134 * @see #DEFAULT_HTTP_REDIRECTED_AUTHENTICATION
137 public static final String HTTP_REDIRECTED_AUTHENTICATION
= PREFIX_CONNECTOR
+ "http.redirectedAuthentication";
140 * The default handling of authentication during HTTP redirects if {@link #HTTP_REDIRECTED_AUTHENTICATION} isn't
145 public static final String DEFAULT_HTTP_REDIRECTED_AUTHENTICATION
= "false";
148 * A flag indicating whether checksums which are retrieved during checksum validation should be persisted in the
149 * local filesystem next to the file they provide the checksum for.
151 * @see #DEFAULT_PERSISTED_CHECKSUMS
153 public static final String PERSISTED_CHECKSUMS
= PREFIX_CONNECTOR
+ "persistedChecksums";
156 * The default checksum persistence mode if {@link #PERSISTED_CHECKSUMS} isn't set.
158 public static final boolean DEFAULT_PERSISTED_CHECKSUMS
= true;
160 private ConfigurationProperties()