Write Method Java Isvalidfilename String Filename String Sys Returns True Filename Represe Q37109135

Write a method in java isValidFilename(String filename, Stringsys) which returns true if filename represents a valid file nameaccording to the rules of the operating system in the secondparameter sys, or false otherwise. Use regular expressions to matchthe following rules for different systems. You can assume thatfilename will never be passed as an empty string and will alwaysinclude a file extension (i.e., file type). If the operating systemsys is “Windows”, then:

 The file name cannot contain any leading or trailingwhitespace characters

 The file name cannot contain any of these special characters:/ ? < > : * | . “

 The

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.