Source Code Cross Referenced for AbstractSshBasedResolver.java in  » Code-Analyzer » apache-ivy » org » apache » ivy » plugins » resolver » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Code Analyzer » apache ivy » org.apache.ivy.plugins.resolver 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         *
017:         */
018:        package org.apache.ivy.plugins.resolver;
019:
020:        import java.io.File;
021:
022:        import org.apache.ivy.core.settings.IvySettings;
023:        import org.apache.ivy.plugins.repository.ssh.AbstractSshBasedRepository;
024:
025:        /**
026:         * Abstract base class for all resolvers using SSH All necessary connection parameters can be set
027:         * here via attributes. However all attributes defined in the pattern url of the resolver will have
028:         * higher priority and will overwrite the values given here. To specify connection parameters in the
029:         * pattern, you have to specify a full url and not just a path as pattern. e.g.
030:         * pattern="/path/to/my/repos/[artifact].[ext]" will use all connection parameters from this class
031:         * e.g. pattern="ssh://myserver.com/path/to/my/repos/[artifact].[ext]" will use all parameters from
032:         * this class with the exception of the host, which will be "myserver.com" e.g.
033:         * pattern="sftp://user:geheim@myserver.com:8022/path/to/my/repos/[artifact].[ext]" will use only
034:         * the keyFile and keyFilePassword from this class (if needed). Rest will come from the url.
035:         */
036:        public abstract class AbstractSshBasedResolver extends
037:                RepositoryResolver {
038:
039:            private boolean passfileSet = false;
040:
041:            public AbstractSshBasedResolver() {
042:                super ();
043:            }
044:
045:            private AbstractSshBasedRepository getSshBasedRepository() {
046:                return ((AbstractSshBasedRepository) getRepository());
047:            }
048:
049:            /**
050:             * Sets the location of the Public Key file to use for authentication
051:             * 
052:             * @param filePath
053:             *            full file path name
054:             */
055:            public void setKeyFile(String filePath) {
056:                getSshBasedRepository().setKeyFile(new File(filePath));
057:            }
058:
059:            /**
060:             * Optional password file. If set the repository will use it as an encypted property file, to
061:             * load username and passwd entries, and to store them if the user choose to do so. Defaults to
062:             * user.dir/.ivy/[host].sftp.passwd, set it to null to disable this feature.
063:             */
064:            public void setPassfile(String passfile) {
065:                getSshBasedRepository().setPassFile(
066:                        passfile == null ? null : new File(passfile));
067:                passfileSet = true;
068:            }
069:
070:            public void setSettings(IvySettings settings) {
071:                super .setSettings(settings);
072:                if (!passfileSet) {
073:                    getSshBasedRepository().setPassFile(
074:                            new File(settings.getDefaultIvyUserDir(),
075:                                    getSshBasedRepository().getHost()
076:                                            + ".ssh.passwd"));
077:                }
078:            }
079:
080:            /**
081:             * Sets the password to authenticate the user if password based login is used if no password is
082:             * set and password based login is used, user will be prompted for it the password can also be
083:             * set by using a full url for the pattern, like
084:             * "sftp://user:password@myserver.com/path/to/repos/[artifact].[ext]"
085:             * 
086:             * @param password
087:             *            to use
088:             */
089:            public void setUserPassword(String password) {
090:                getSshBasedRepository().setUserPassword(password);
091:            }
092:
093:            /**
094:             * Sets the password to use for decrypting key file (if it is encrypted) if no password is set
095:             * and the keyfile is encrypted, the user will be prompted for the password if the keyfile is
096:             * passwordless, this parameter will be ignored if given
097:             * 
098:             * @param password
099:             *            to use
100:             */
101:            public void setKeyFilePassword(String password) {
102:                getSshBasedRepository().setKeyFilePassword(password);
103:            }
104:
105:            /**
106:             * sets the user to use for the ssh communication the user can also be set by using a full url
107:             * for the pattern, like "ssh://user@myserver.com/path/to/repos/[artifact].[ext]"
108:             * 
109:             * @param user
110:             *            on the target system
111:             */
112:            public void setUser(String user) {
113:                getSshBasedRepository().setUser(user);
114:            }
115:
116:            /**
117:             * sets the host to use for the ssh communication the host can also be set by using a full url
118:             * for the pattern, like "ssh://myserver.com/path/to/repos/[artifact].[ext]"
119:             * 
120:             * @param host
121:             *            of the target system
122:             */
123:            public void setHost(String host) {
124:                getSshBasedRepository().setHost(host);
125:            }
126:
127:            /**
128:             * sets the port to use for the ssh communication port 22 is default the port can also be set by
129:             * using a full url for the pattern, like
130:             * "sftp://myserver.com:8022/path/to/repos/[artifact].[ext]"
131:             * 
132:             * @param port
133:             *            of the target system
134:             */
135:            public void setPort(int port) {
136:                getSshBasedRepository().setPort(port);
137:            }
138:
139:            public abstract String getTypeName();
140:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.