class Utilities {

	public static byte[] readFileContent(final String filePath) throws APIRestGeneratorException
	{
		Path path = null ;
		
        if (filePath.toLowerCase().startsWith(ConstantsInput.SO_PATH_STRING_PREFIX))
        {
        	path = Paths.get(URI.create(filePath)) ;
        }
        else
        {
        	path = Paths.get(filePath, new String[0]) ;
        }
		
        byte[] fileContent = null ;
        
		if (Files.exists(path, new LinkOption[0]))
		{
			try 
			{
				fileContent = FileUtils.readFileToByteArray(path.toFile()) ;
			} 
			catch (IOException ioException)
			{
		    	final String errorString = "IOException when reading the file '" + filePath + "': " + ioException ;
		    	
		    	Utilities.LOGGER.error(errorString, ioException) ;
		    	throw new APIRestGeneratorException(errorString, ioException) ;
			}
		}
		
		return fileContent ;
	}

	private  Utilities();

}