Skip to content

Commit 817c612

Browse files
committed
Javadoc: Better exception description
1 parent c60993e commit 817c612

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FTPClientWrapper.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ public boolean completePendingCommand() throws IOException {
9898
return true;
9999
}
100100

101+
/**
102+
* Creates an FTP client.
103+
*
104+
* @return a new FTP client.
105+
* @throws FileSystemException if an error occurs while establishing a connection.
106+
*/
101107
private FTPClient createClient() throws FileSystemException {
102108
final GenericFileName rootName = getRoot();
103109
UserAuthenticationData authData = null;
@@ -111,10 +117,11 @@ private FTPClient createClient() throws FileSystemException {
111117

112118
/**
113119
* Creates an FTPClient.
120+
*
114121
* @param rootFileName the root file name.
115122
* @param authData authentication data.
116123
* @return an FTPClient.
117-
* @throws FileSystemException if a file system error occurs.
124+
* @throws FileSystemException if an error occurs while establishing a connection.
118125
*/
119126
protected FTPClient createClient(final GenericFileName rootFileName, final UserAuthenticationData authData)
120127
throws FileSystemException {
@@ -162,7 +169,13 @@ public FileSystemOptions getFileSystemOptions() {
162169
return fileSystemOptions;
163170
}
164171

165-
private FTPClient getFtpClient() throws FileSystemException {
172+
/**
173+
* Package-private for debugging only, consider private.
174+
*
175+
* @return the actual FTP client.
176+
* @throws FileSystemException if an error occurs while establishing a connection.
177+
*/
178+
FTPClient getFtpClient() throws FileSystemException {
166179
if (ftpClient == null) {
167180
ftpClient = createClient();
168181
}

commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private void configureClient(final FileSystemOptions fileSystemOptions, final C
123123
* @param workingDirectory The working directory.
124124
* @param fileSystemOptions Options to create the connection.
125125
* @return A new connection.
126-
* @throws FileSystemException if an error occurs while connecting.
126+
* @throws FileSystemException if an error occurs while establishing a connection.
127127
*/
128128
public C createConnection(final String hostname, final int port, char[] username, char[] password,
129129
final String workingDirectory, final FileSystemOptions fileSystemOptions) throws FileSystemException {
@@ -277,7 +277,7 @@ protected void setupOpenConnection(final FTPClient client, final FileSystemOptio
277277
* @param workingDirectory The base directory.
278278
* @param fileSystemOptions The FileSystemOptions.
279279
* @return An FTPClient.
280-
* @throws FileSystemException if an error occurs while connecting.
280+
* @throws FileSystemException if an error occurs while establishing a connection.
281281
*/
282282
public static FTPClient createConnection(final String hostname, final int port, final char[] username,
283283
final char[] password, final String workingDirectory, final FileSystemOptions fileSystemOptions)

commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected void setupOpenConnection(final FTPSClient client, final FileSystemOpti
8484
* @param workingDirectory The directory to use.
8585
* @param fileSystemOptions The FileSystemOptions.
8686
* @return The FTPSClient.
87-
* @throws FileSystemException if an error occurs.
87+
* @throws FileSystemException if an error occurs while establishing a connection.
8888
*/
8989
public static FTPSClient createConnection(final String hostname, final int port, final char[] username,
9090
final char[] password, final String workingDirectory, final FileSystemOptions fileSystemOptions)

0 commit comments

Comments
 (0)