Package com.github.mike10004.xvfbmanager
Class FramebufferDirScreenshooter
- java.lang.Object
-
- com.github.mike10004.xvfbmanager.FramebufferDirScreenshooter
-
- All Implemented Interfaces:
Screenshooter<XwdFileScreenshot>
public class FramebufferDirScreenshooter extends Object implements Screenshooter<XwdFileScreenshot>
Screenshooter implementation that copies the framebuffer file from the framebuffer directory. See the-fbdiroption toXvfbin the manual.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.mike10004.xvfbmanager.Screenshooter
Screenshooter.ScreenshooterException
-
-
Constructor Summary
Constructors Constructor Description FramebufferDirScreenshooter(File framebufferDir, int screen, File outputDir)Constructs a new instance of the class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XwdFileScreenshotcapture()Captures a screenshot.protected StringconstructFramebufferFilename()protected FileconstructOutputPathname(File outputDir)Constructs the output file pathname.
-
-
-
Constructor Detail
-
FramebufferDirScreenshooter
public FramebufferDirScreenshooter(File framebufferDir, int screen, File outputDir)
Constructs a new instance of the class.- Parameters:
framebufferDir- the directory containing the framebuffer filescreen- the screen; see-screenoption in theXvfbmanualoutputDir- directory to which the output file will be written
-
-
Method Detail
-
constructFramebufferFilename
protected String constructFramebufferFilename()
-
capture
public XwdFileScreenshot capture() throws IOException, XvfbException
Description copied from interface:ScreenshooterCaptures a screenshot.- Specified by:
capturein interfaceScreenshooter<XwdFileScreenshot>- Returns:
- the screenshot
- Throws:
IOException- if capture encounters an I/O errorXvfbException- if a virtual framebuffer error occurs
-
constructOutputPathname
protected File constructOutputPathname(File outputDir) throws IOException
Constructs the output file pathname. This implementation creates a temporary file with unique name.- Parameters:
outputDir- directory in which file will be a child- Returns:
- the pathname
- Throws:
IOException- if something goes awry
-
-