Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * Check if a character is allowed in a filename (if it is a valid input)
     *
     * @param currentChar the entered char
     * @return if it is allowed or not to be used in a filename
     */
    private static boolean isFileCharAllowed(char currentChar) {
        boolean isCharAllowed = false;

        String reservedChars = "?:\"*|/\\<>";
        if (reservedChars.indexOf(currentChar) == -1) {
            isCharAllowed = true;
        }

        return isCharAllowed;
    }
}