set the value file

@param file value to set
@throws ApplicationException
779110
public void setFile(String file) throws ApplicationException {
	if (StringUtil.isEmpty(file)) return;

	if (file.indexOf('/') != -1 || file.indexOf('\\') != -1)
	    throw new ApplicationException("value [" + file + "] from attribute [file] at tag [log] can only contain a filename, file separators like [\\/] are not allowed");
	if (!file.endsWith(".log")) file += ".log";
	this.file = file;
    }
775191
public RequestBuilder<Resource> set(final String name, final File file) {
		return set(name, file != null ? new FileBody(file) : null);
	}
1015254
public void setTo(Object to) throws ApplicationException {
	if (StringUtil.isEmpty(to)) return;
	try {
	    smtp.addTo(to);
	}
	catch (Exception e) {
	    throw new ApplicationException("attribute [to] of the tag [mail] is invalid", e.getMessage());
	}
    }
13188
public void setFiles(java.util.Collection<StreamFile> files) {
        if (files == null) {
            this.files = null;
            return;
        }

        this.files = new java.util.ArrayList<StreamFile>(files);
    }
24179
@Override
    public void setFile(File file) {
        configFile = file;
        if (tc.isDebugEnabled())
            Tr.debug(tc, "Jaspi configuration of persistent providers will be stored in file: " + file);
    }
1320874
public void setDirectory( File file ) {

		List<File> roots = null;
		if( file == null ) {
			// Create a list of roots with something in them.  Windows list to list non-existant devices
			roots = new ArrayList<>(Arrays.asList(File.listRoots()));
			for (int i = roots.size()-1; i >= 0; i--) {
				File[]files = roots.get(i).listFiles();
				if( files == null || files.length == 0) {
					roots.remove(i);
				}
			}

			if( roots.size() == 1 ) {
				file = roots.get(0);
				roots = null;
			}
		}

		if( roots == null ) {
			setDirectoryNormal(file);
		} else {
			// Present the user with a list of file system roots
			fileName.setText("");

			listModel.clear();
			for (File f : roots) {
				listModel.addElement(f);
			}

			directoryPath.removeActionListener(directoryListener);
			directoryPath.removeAllItems();
			directoryPath.addActionListener(directoryListener);

			listener.handleSelectedFile(null);
		}
	}
587621
public void setType(String type) throws ApplicationException {
	type = type.toLowerCase().trim();
	if (type.equals("page")) this.type = lucee.runtime.exp.Abort.SCOPE_PAGE;
	else if (type.equals("request")) this.type = lucee.runtime.exp.Abort.SCOPE_REQUEST;
	else throw new ApplicationException("attribute type has an invalid value [" + type + "], valid values are [page,request]");
    }
767493
public void setScope(String scope) throws ApplicationException {
	scope = scope.toLowerCase().trim();

	if (scope.equals("server")) this.scope = SCOPE_SERVER;
	else if (scope.equals("application")) this.scope = SCOPE_APPLICATION;
	else if (scope.equals("session")) this.scope = SCOPE_SESSION;
	else if (scope.equals("request")) this.scope = SCOPE_REQUEST;
	else throw new ApplicationException("invalid value [" + scope + "] for attribute [scope] from tag [lock]", "valid values are [server,application,session]");
    }
402189
public function addResource(string $file): void
    {
        $contents = file_get_contents($file);
        
        if ($contents === false) {
            throw new \RuntimeException("Error reading file at $file.");
        }
        
        $this->processData(json_decode($contents, true));
    }
482073
public static void copyFile(File from, File to) throws RuntimeIOException {
		copyFile(from, to, false);
	}
1228524
public void loadFile(File file)
   {
      try
      {
         m_projectFile = new UniversalProjectReader().read(file);
         if (m_projectFile == null)
         {
            throw new IllegalArgumentException("Unsupported file type");
         }
      }

      catch (Exception ex)
      {
         throw new RuntimeException(ex);
      }

      MpxjTreeNode projectNode = new MpxjTreeNode(m_projectFile, FILE_EXCLUDED_METHODS)
      {
         @Override public String toString()
         {
            return "Project";
         }
      };

      MpxjTreeNode configNode = new MpxjTreeNode(m_projectFile.getProjectConfig())
      {
         @Override public String toString()
         {
            return "MPXJ Configuration";
         }
      };
      projectNode.add(configNode);

      MpxjTreeNode propertiesNode = new MpxjTreeNode(m_projectFile.getProjectProperties())
      {
         @Override public String toString()
         {
            return "Properties";
         }
      };
      projectNode.add(propertiesNode);

      MpxjTreeNode tasksFolder = new MpxjTreeNode("Tasks");
      projectNode.add(tasksFolder);
      addTasks(tasksFolder, m_projectFile);

      MpxjTreeNode resourcesFolder = new MpxjTreeNode("Resources");
      projectNode.add(resourcesFolder);
      addResources(resourcesFolder, m_projectFile);

      MpxjTreeNode assignmentsFolder = new MpxjTreeNode("Assignments");
      projectNode.add(assignmentsFolder);
      addAssignments(assignmentsFolder, m_projectFile);

      MpxjTreeNode calendarsFolder = new MpxjTreeNode("Calendars");
      projectNode.add(calendarsFolder);
      addCalendars(calendarsFolder, m_projectFile);

      MpxjTreeNode groupsFolder = new MpxjTreeNode("Groups");
      projectNode.add(groupsFolder);
      addGroups(groupsFolder, m_projectFile);

      MpxjTreeNode customFieldsFolder = new MpxjTreeNode("Custom Fields");
      projectNode.add(customFieldsFolder);
      addCustomFields(customFieldsFolder, m_projectFile);

      MpxjTreeNode filtersFolder = new MpxjTreeNode("Filters");
      projectNode.add(filtersFolder);

      MpxjTreeNode taskFiltersFolder = new MpxjTreeNode("Task Filters");
      filtersFolder.add(taskFiltersFolder);
      addFilters(taskFiltersFolder, m_projectFile.getFilters().getTaskFilters());

      MpxjTreeNode resourceFiltersFolder = new MpxjTreeNode("Resource Filters");
      filtersFolder.add(resourceFiltersFolder);
      addFilters(resourceFiltersFolder, m_projectFile.getFilters().getResourceFilters());

      MpxjTreeNode viewsFolder = new MpxjTreeNode("Views");
      projectNode.add(viewsFolder);
      addViews(viewsFolder, m_projectFile);

      MpxjTreeNode tablesFolder = new MpxjTreeNode("Tables");
      projectNode.add(tablesFolder);
      addTables(tablesFolder, m_projectFile);

      m_model.setRoot(projectNode);
   }
1005309
public void onFileChange(File file) {
        LOG.info("File updated : {}", file.getAbsolutePath());
        onFileDelete(file);
        onFileCreate(file);
    }
1019267
public static void addFile(State state, String file) {
    state.setProp(ADD_FILES, state.getProp(ADD_FILES, "") + "," + file);
  }
589747
public void setType(String type) throws ApplicationException {
	type = type.toLowerCase().trim();
	if (type.equals("information")) this.type = lucee.commons.io.log.Log.LEVEL_INFO;
	else if (type.equals("info")) this.type = lucee.commons.io.log.Log.LEVEL_INFO;
	else if (type.equals("warning")) this.type = lucee.commons.io.log.Log.LEVEL_WARN;
	else if (type.equals("warn")) this.type = lucee.commons.io.log.Log.LEVEL_WARN;
	else if (type.equals("error")) this.type = lucee.commons.io.log.Log.LEVEL_ERROR;
	else if (type.startsWith("fatal")) this.type = lucee.commons.io.log.Log.LEVEL_FATAL;
	else if (type.startsWith("debug")) this.type = lucee.commons.io.log.Log.LEVEL_DEBUG;
	else if (type.startsWith("trace")) this.type = lucee.commons.io.log.Log.LEVEL_TRACE;
	else throw new ApplicationException("invalid value for attribute type [" + type + "]", "valid values are [information,warning,error,fatal,debug]");

    }
1067330
public void setPersistedFile(File file) throws FileNotFoundException
   {
      if (file instanceof SwapFile)
      {
         ((SwapFile)file).acquire(this);
      }

      this.file = file;

      // JCR-2326 Release the current ValueData from tempFile users before
      // setting its reference to null so it will be garbage collected.
      if (this.tempFile != null)
      {
         this.tempFile.release(this);
         this.tempFile = null;
      }

      this.stream = null;
   }
348484
private void setFileHandle() {
        byte[] fileHandle = null;
        if (_isRootFile) {
            fileHandle = getNfs().getRootFileHandle();
        } else {
            try {
                if (getParentFile().getFileHandle() != null) {
                    fileHandle = getNfs().wrapped_getLookup(makeLookupRequest()).getFileHandle();
                }
            } catch (IOException e) {
                // do nothing, this will be a common exception
            }
        }
        setFileHandle(fileHandle);
    }
1114804
public void setFile(File file) {
		if(file != null) {
			this.file = file;
			
			// Replace the label by the file's name.
			this.setLabel(file.getName());
			
			// Change the icon, depending if the file is a folder or not.
			this.updateIcon();
		}
	}