public void setOption()

in contribs/LeosLiterak/TempFileAppender.java [107:135]


  public void setOption(String key, String value) {
      super.setOption(key, value);
      if(key.equalsIgnoreCase(PATH_OPTION)) {
	  path = value;
	  if(path==null) {
              errorHandler.error("Path cannot be empty!",null,0);
	  }

	  dir = new File(path);
	  if(!(dir.exists() && dir.isDirectory() && dir.canWrite())) {
              errorHandler.error("Cannot write to directory " + path + "!",null,0);
	  }
      }
      else if(key.equalsIgnoreCase(PREFIX_OPTION)) {
          if(value!=null && value.length()>=3) {
	      prefix = value;
	  } else {
              errorHandler.error("Prefix cannot be shorter than 3 characters!",
	                         null,0);
	  }
      }
      else if(key.equalsIgnoreCase(SUFFIX_OPTION)) {
          if(value!=null && value.length()>=1) {
	      suffix = value;
	  } else {
              errorHandler.error("Suffix cannot be empty!",null,0);
	  }
      }
  }