< prev index next >
src/java.base/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java
Print this page
rev 51919 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: dfuchs, alanb
@@ -339,11 +339,11 @@
}
if (path != null && path.length() > 1 &&
path.charAt(0) == '/') {
path = path.substring(1);
}
- if (path == null || path.length() == 0) {
+ if (path == null || path.isEmpty()) {
path = "./";
}
if (!path.endsWith("/")) {
i = path.lastIndexOf('/');
if (i > 0) {
@@ -553,11 +553,11 @@
if (os != null) {
return os;
}
decodePath(url.getPath());
- if (filename == null || filename.length() == 0) {
+ if (filename == null || filename.isEmpty()) {
throw new IOException("illegal filename for a PUT");
}
try {
if (pathname != null) {
cd(pathname);
< prev index next >