How do we split with and without dates and hours in java? : Currently i am getting all the below URL's from the list using the java.


    1. Input - /folder1/folder2/folder3/folder4/folder5/dt=2017-10-05/hour=00/
    2. Input - /folder1/folder2/folder3/folder4/folder5/dt=2017-10-05/
    3. Input - /folder1/folder2/folder3/folder4/folder5/done_dt=2017-10-05.lst
    4. Input - /folder1/folder2/folder3/folder4/folder5/20171005/00/
    5. Input - /folder1/folder2/folder3/folder4/folder5/20171005/
    6. Input - hdfs://location-one/mnt/hadoop/abc/cded/2017-10-05/
    7. Input - /folder1/folder2/folder3/folder4/folder5/folder6/20171005/
    8. Input - /folder1/folder2/folder3/folder4/folder5/dt=2017-10-05/hour=00/_done
    9. Input - /folder1/folder2/folder3/folder4/folder5/

How do i remove the dates, hours if it presents and finally pass this values to the database to the exact match.
Required value is:

    1. Input - /folder1/folder2/folder3/folder4/folder5/
    2. Input - /folder1/folder2/folder3/folder4/folder5/
    3. Input - /folder1/folder2/folder3/folder4/folder5/
    4. Input - /folder1/folder2/folder3/folder4/folder5/
    5. Input - /folder1/folder2/folder3/folder4/folder5/
    6. Input - hdfs://location-one/mnt/hadoop/abc/cded/
    7. Input - /folder1/folder2/folder3/folder4/folder5/folder6/
    8. Input - /folder1/folder2/folder3/folder4/folder5/
    9. Input - /folder1/folder2/folder3/folder4/folder5/

Suggest any ideas.