# Issues with Designer Hook shutdown method

**URL:** <https://forum.inductiveautomation.com/t/issues-with-designer-hook-shutdown-method/16979>\
**Category:** 3rd Party Modules\
**Created:** [February 14, 2018, 4:32am UTC](https://forum.inductiveautomation.com/t/issues-with-designer-hook-shutdown-method/16979 "2018-02-14T04:32:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yogini\_Marathe](https://avatars.discourse-cdn.com/v4/letter/y/85e7bf/32.png) [@Yogini\_Marathe](https://forum.inductiveautomation.com/u/Yogini_Marathe)\
**Post date:** [February 14, 2018, 4:32am UTC](https://forum.inductiveautomation.com/t/issues-with-designer-hook-shutdown-method/16979/1 "2018-02-14T04:32:39Z")

</div>

I am trying to do some cleanup tasks in the DesignerHook shutdown method.  
Basically trying to delete some temporary files that were created in my custom component.

Following is what I want to do -

String userHomeDirectory = System.getProperty(“user.home”);

```
    File dir = new File(userHomeDirectory);
    FileFilter fileFilter = new WildcardFileFilter(".mymodule*");
    File[] files = dir.listFiles(fileFilter);
    //delete the files that start with name above
    for (int i = 0; i < files.length; i++) {
    	try {
		FileUtils.deleteDirectory(files[i]);
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}

```

This works perfectly when written in ClientHook shutdown method.  
However is not working from DesignerHook shutdown method.

When some one runs the component from designer, temporary files get created but I believe Designer Hook shutdown is not getting called and temporary files are not deleted.

Tested this on 7.9.4 , 7.9.5 and 7.9.6  
Java version 7.8.0\_161

Appreciate any help in this regard.
