Last change
on this file since 29855 was 29855, checked in by davidb, 9 years ago |
John's code after refactoring by Tom over the summer of 2014/2015
|
File size:
826 bytes
|
Line | |
---|
1 | /*
|
---|
2 | * To change this template, choose Tools | Templates
|
---|
3 | * and open the template in the editor.
|
---|
4 | */
|
---|
5 | package web.listeners;
|
---|
6 |
|
---|
7 | import java.io.File;
|
---|
8 | import javax.servlet.http.HttpSessionAttributeListener;
|
---|
9 | import javax.servlet.http.HttpSessionBindingEvent;
|
---|
10 |
|
---|
11 | /**
|
---|
12 | *
|
---|
13 | * @author OEM
|
---|
14 | */
|
---|
15 | public class MyHttpSessionAttributeListener implements HttpSessionAttributeListener {
|
---|
16 |
|
---|
17 | public void attributeAdded(HttpSessionBindingEvent event) {
|
---|
18 | //do nothing
|
---|
19 | }
|
---|
20 |
|
---|
21 | public void attributeRemoved(HttpSessionBindingEvent event) {
|
---|
22 | //do nothing
|
---|
23 | }
|
---|
24 |
|
---|
25 | public void attributeReplaced(HttpSessionBindingEvent event) {
|
---|
26 | if (event.getName().equals("filepath")) {
|
---|
27 | File file = new File((String) event.getValue());
|
---|
28 | if (file.exists()) {
|
---|
29 | file.delete();
|
---|
30 | }
|
---|
31 | }
|
---|
32 | }
|
---|
33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.