Hello
Im trying to do some basic FTP work.
What I am trying to do is:
1: Search for a folder named "hi" in "C:". If hi exists, enter it. If it doesnt, create it THEN enter it.
2: Inside hi, count FILES and see if there is greater or less than 44. If there is less than 44, create a file named "bye" inside
3: If there is more than 44, I should make a "hi2" in C. Repeat step 2 and 3 with hi2..(if greater than 44)...3....(if greater than 44)......4..... (if greater than 44).....5
I think the general picture is captured.
For now I have this:
FTPClient f=new FTPClient();
try
{
f.connect("192.168.100.1");
f.login("user","pass");
f.changeWorkingDirectory("/");
FTPFile[] list = f.listFiles();
String cai="hi";
int totalDIRS = 0;
int totalFILES = 0;
int doesfolderexist=0;
for (int i=0;i<list.length;i++)
{
if (list[i].getType() == FTPFile.DIRECTORY_TYPE)
{
if (list[i].getName().equals(cai))
{
}
else
{
f.makeDirectory(cai);
existcinternet=1;
}
System.out.println(list[i].getName());
}
}
For now, Im not sure where else to continue (as sad as it sounds)
Some hints?
Thank you