In order to use mod_rewrite
you can type the following command in the terminal:
sudo a2enmod rewrite
Restart apache2 after
sudo /etc/init.d/apache2 restart
or
sudo service apache2 restart
or as per new unified System Control Way
sudo systemctl restart apache2
Then, if you'd like, you can use the following .htaccess
file.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
The above .htaccess
file (if placed in your DocumentRoot
) will redirect all traffic to an index.php
file in the DocumentRoot
unless the file exists.
So, let's say you have the following directory structure and httpdocs is the DocumentRoot
httpdocs/
.htaccess
index.php
images/
hello.png
js/
jquery.js
css/
style.css
includes/
app/
app.php
Any file that exists in httpdocs will be served to the requester using the .htaccess
shown above, however, everything else will be redirected to httpdocs/index.php
. Your application files in includes/app
will not be accessible.
Java
Yes, it is possible. The following example is in Java:
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com/");
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
// Now you can do whatever you need to do with it, for example copy somewhere
FileUtils.copyFile(scrFile, new File("c:\\tmp\\screenshot.png"));
Best Answer
Download The latest stable release: Apache POI 3.16-FINAL distribution,
open your eclipse project properties,
Java Built Path > Libraries > Add external JARs,
then extract the zip file you downloaded and navigate the extracted folder,
select all the JARs under the sub folders (docs, lib, ooxml-lib),
then finally in the Order and Export section put marks to jar libs you just added,
and click OK.