Convert URL to filename using lambdaj

import ch.lambdaj.function.convert.Converter;
 
import java.net.URL;
 
public class ConvertUrlToFileName implements Converter<URL, String>
{
   public static ConvertUrlToFileName convertUrlToFileName()
   {
      return new ConvertUrlToFileName();
   }
 
   @Override
   public String convert(final URL from)
   {
      return from.getFile();
   }
}

Leave a Reply

Your email address will not be published. Required fields are marked *