Attrib (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs.optional.windows, class: Attrib

Package org.apache.tools.ant.taskdefs.optional.windows

# Class Attrib

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.ExecTask
org.apache.tools.ant.taskdefs.ExecuteOn
org.apache.tools.ant.taskdefs.optional.windows.Attrib

All Implemented Interfaces:
  `Cloneable`

public class Attrib extends ExecuteOn
Attrib equivalent for Win32 environments. Note: Attrib parameters /S and /D are not handled.

Since:
  Ant 1.6

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.tools.ant.taskdefs.ExecuteOn

  `ExecuteOn.FileDirBoth`

- ## Field Summary

  ### Fields inherited from class org.apache.tools.ant.taskdefs.ExecuteOn

  `destDir, filesets, mapper, mapperElement, srcFilePos, srcIsFirst, targetFilePos, type`

  ### Fields inherited from class org.apache.tools.ant.taskdefs.ExecTask

  `cmdl, failOnError, newEnvironment, redirector, redirectorElement`

  ### Fields inherited from class org.apache.tools.ant.Task

  `target, taskName, taskType, wrapper`

  ### Fields inherited from class org.apache.tools.ant.ProjectComponent

  `description, location, project`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Attrib()`
  Constructor for Attrib.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `checkConfiguration()`
  Check the attributes.
  `protected boolean`
  `isValidOs()`
  Check if the os is valid.
  `void`
  `setAddsourcefile​(boolean b)`
  Add source file.
  `void`
  `setArchive​(boolean value)`
  Set the Archive file attribute.
  `void`
  `setCommand​(String e)`
  Set the executable.
  `void`
  `setExecutable​(String e)`
  Set the executable.
  `void`
  `setFile​(File src)`
  A file to be attribed.
  `void`
  `setHidden​(boolean value)`
  Set the Hidden file attribute.
  `void`
  `setMaxParallel​(int max)`
  Set max parallel.
  `void`
  `setParallel​(boolean parallel)`
  Set parallel.
  `void`
  `setReadonly​(boolean value)`
  Set the ReadOnly file attribute.
  `void`
  `setSkipEmptyFilesets​(boolean skip)`
  Set skip empty file sets.
  `void`
  `setSystem​(boolean value)`
  Set the System file attribute.

  ### Methods inherited from class org.apache.tools.ant.taskdefs.ExecuteOn

  `add, add, addDirset, addFilelist, addFileset, createHandler, createMapper, createSrcfile, createTargetfile, getCommandline, getCommandline, getDirs, getFiles, getFilesAndDirs, runExec, runParallel, setDest, setForce, setForwardslash, setIgnoremissing, setRelative, setType, setupRedirector, setVerbose`

  ### Methods inherited from class org.apache.tools.ant.taskdefs.ExecTask

  `addConfiguredRedirector, addEnv, createArg, createWatchdog, execute, getOs, getOsFamily, getResolveExecutable, logFlush, maybeSetResultPropertyValue, prepareExec, resolveExecutable, runExecute, setAppend, setCommand, setDir, setDiscardError, setDiscardOutput, setError, setErrorProperty, setFailIfExecutionFails, setFailonerror, setInput, setInputString, setLogError, setNewenvironment, setOs, setOsFamily, setOutput, setOutputproperty, setResolveExecutable, setResultProperty, setSearchPath, setSpawn, setTimeout, setTimeout, setVMLauncher`

  ### Methods inherited from class org.apache.tools.ant.Task

  `bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType`

  ### Methods inherited from class org.apache.tools.ant.ProjectComponent

  `clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject`

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Attrib

    public Attrib()
    Constructor for Attrib.

- ## Method Details

  - ### setFile

    public void setFile​(File src)
    A file to be attribed.
    Parameters:
      `src` - a file

  - ### setReadonly

    public void setReadonly​(boolean value)
    Set the ReadOnly file attribute.
    Parameters:
      `value` - a `boolean` value

  - ### setArchive

    public void setArchive​(boolean value)
    Set the Archive file attribute.
    Parameters:
      `value` - a `boolean` value

  - ### setSystem

    public void setSystem​(boolean value)
    Set the System file attribute.
    Parameters:
      `value` - a `boolean` value

  - ### setHidden

    public void setHidden​(boolean value)
    Set the Hidden file attribute.
    Parameters:
      `value` - a `boolean` value

  - ### checkConfiguration

    protected void checkConfiguration()
    Check the attributes.
    Overrides:
      `checkConfiguration` in class `ExecuteOn`

  - ### setExecutable

    public void setExecutable​(String e)
    Set the executable. This is not allowed, and it always throws a BuildException.
    Overrides:
      `setExecutable` in class `ExecTask`
    Parameters:
      `e` - ignored

  - ### setCommand

    public void setCommand​(String e)
    Set the executable. This is not allowed, and it always throws a BuildException.
    Parameters:
      `e` - ignored

  - ### setAddsourcefile

    public void setAddsourcefile​(boolean b)
    Add source file. This is not allowed, and it always throws a BuildException.
    Overrides:
      `setAddsourcefile` in class `ExecuteOn`
    Parameters:
      `b` - ignored

  - ### setSkipEmptyFilesets

    public void setSkipEmptyFilesets​(boolean skip)
    Set skip empty file sets. This is not allowed, and it always throws a BuildException.
    Overrides:
      `setSkipEmptyFilesets` in class `ExecuteOn`
    Parameters:
      `skip` - ignored

  - ### setParallel

    public void setParallel​(boolean parallel)
    Set parallel. This is not allowed, and it always throws a BuildException.
    Overrides:
      `setParallel` in class `ExecuteOn`
    Parameters:
      `parallel` - ignored

  - ### setMaxParallel

    public void setMaxParallel​(int max)
    Set max parallel. This is not allowed, and it always throws a BuildException.
    Overrides:
      `setMaxParallel` in class `ExecuteOn`
    Parameters:
      `max` - ignored

  - ### isValidOs

    protected boolean isValidOs()
    Check if the os is valid. Default is to allow windows
    Overrides:
      `isValidOs` in class `ExecTask`
    Returns:
      true if the os is valid.