satmisha
asked on
convert Absolute path to relative path of FTP location
Hi Team,
I am using below FTP path in my code. I want to use relative path instead rather absolute path. Is it possible to convert this path into relative path ?
Looking forward to hearing from you.
I am using below FTP path in my code. I want to use relative path instead rather absolute path. Is it possible to convert this path into relative path ?
String FTPLocation = "44.24.10.11/upload/AutomationUploadFolder/Test-2.csv";
AIP.enterFileLocation(FTPLocation);
Looking forward to hearing from you.
What is your motivation?
Hi Satmisha,
Conversion of an absolute path to relative path will require the base path first.
You can achieve that using relativize API of Path class. Check here https://docs.oracle.com/ja vase/7/doc s/api/java /nio/file/ Path.html# relativize (java.nio. file.Path)
You can get path from the file object too using toPath() method.
Best Regards,
Saurav
Conversion of an absolute path to relative path will require the base path first.
You can achieve that using relativize API of Path class. Check here https://docs.oracle.com/ja
You can get path from the file object too using toPath() method.
Best Regards,
Saurav
ASKER
Thanks experts for your prompt reply.
But I am sorry I am still unable to get ? first of all I myself confuse here, Is it possible what I am looking for ?
But I am sorry I am still unable to get ? first of all I myself confuse here, Is it possible what I am looking for ?
//44.24.10.11 --> is the ip of the FTP location
String FTPLocation = "44.24.10.11/upload/AutomationUploadFolder/Test-2.csv";
AIP.enterFileLocation(FTPLocation);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
a. what are you starting with?
b. what end result do you want?
You've told us a. but for some reason, not b.
b. what end result do you want?
You've told us a. but for some reason, not b.
ASKER
Thanks Saurav for the greate explanation, appreciate your time. I got the point though. Thank you.
Glad to provide you with help Satmisha.
Best Regards,
Saurav
Best Regards,
Saurav