sureshanaparti commented on code in PR #6548:
URL: https://github.com/apache/cloudstack/pull/6548#discussion_r918756877
##########
vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/DatastoreMO.java:
##########
@@ -314,16 +316,19 @@ public String[] listDirContent(String path) throws
Exception {
public boolean fileExists(String fileFullPath) throws Exception {
DatastoreFile file = new DatastoreFile(fileFullPath);
DatastoreFile dirFile = new DatastoreFile(file.getDatastoreName(),
file.getDir());
-
- HostDatastoreBrowserMO browserMo = getHostDatastoreBrowserMO();
-
- s_logger.info("Search file " + file.getFileName() + " on " +
dirFile.getPath());
- HostDatastoreBrowserSearchResults results =
browserMo.searchDatastore(dirFile.getPath(), file.getFileName(), true);
- if (results != null) {
- List<FileInfo> info = results.getFile();
- if (info != null && info.size() > 0) {
- s_logger.info("File " + fileFullPath + " exists on datastore");
- return true;
+ Boolean folderExists = true;
Review Comment:
is this true by default?
##########
vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/DatastoreMO.java:
##########
@@ -314,16 +316,19 @@ public String[] listDirContent(String path) throws
Exception {
public boolean fileExists(String fileFullPath) throws Exception {
DatastoreFile file = new DatastoreFile(fileFullPath);
DatastoreFile dirFile = new DatastoreFile(file.getDatastoreName(),
file.getDir());
-
- HostDatastoreBrowserMO browserMo = getHostDatastoreBrowserMO();
-
- s_logger.info("Search file " + file.getFileName() + " on " +
dirFile.getPath());
- HostDatastoreBrowserSearchResults results =
browserMo.searchDatastore(dirFile.getPath(), file.getFileName(), true);
- if (results != null) {
- List<FileInfo> info = results.getFile();
- if (info != null && info.size() > 0) {
- s_logger.info("File " + fileFullPath + " exists on datastore");
- return true;
+ Boolean folderExists = true;
+ if(StringUtils.isNotBlank(file.getDir())){
Review Comment:
```suggestion
if(StringUtils.isNotBlank(file.getDir())) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]