/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6427768
* @summary FtpURLConnection doesn't close FTP connection when login fails
* @build FtpServer FtpCommandHandler FtpAuthHandler FtpFileSystemHandler
*/
public class B6427768 {
// Need to test when login fails, so AuthHandler should always return
// false
public int authType() {
return 2;
}
return false;
}
return false;
}
}
currentDir = path;
}
currentDir = path;
return true;
}
public boolean cdUp() {
return true;
}
return currentDir;
}
return null;
}
return -1;
}
return false;
}
return null;
}
return null;
}
return false;
}
return false;
}
return false;
}
}
// triggers the connection
try {
// Give some time to the client thread to properly terminate.
try {
} catch (InterruptedException ie) {
// shouldn't happen
}
// If there are still active clients attached to the FTP
// server, it means we didn't quit properly
throw new RuntimeException("URLConnection didn't close the ftp connection on failure to login");
}
} finally {
}
}
}