Skip to main content

First of all, i'd doI'd leave the SqlJetException unchecked and not catch it in close method. I hate exceptions in close methods because why do i supposewhat am I supposed to do with it? If iI could do anything, i'veI've already caught it, but most times i have to mute it "catch(xxxx)has to be muted {}"catch(xxxx) {}.

I never useruse printStackTrace.

Does the GetDirectoryContent method insert records? The name is not clear enough, it supposesit's supposed to get a directory content, not insert any content. And it returns nothing... I think it'd be a better name would be something like

saveContentFrom(String directory)

Is this class a public API? If so, I would check for errors like "this param is null", but if not, i would not check anything like that.

CreateDatabase, OpenDatabaseConnection and CloseDatabaseConnection are public, and you use them in GetDirectoryContent... what would happen if someone creates a database an calland calls your GetDirectoryContent? I would make those 3 methods private.

First of all, i'd do the SqlJetException unchecked and not catch it in close method. I hate exceptions in close methods because why do i suppose to do with it? If i could do anything, i've caught it, but most times i have to mute it "catch(xxxx) {}"

I never user printStackTrace.

Does GetDirectoryContent method insert records? The name is not clear enough, it supposes to get a directory content, not insert any content. And it returns nothing... I think it'd be a better name something like

saveContentFrom(String directory)

Is this class a public API? If so, I would check for errors like "this param is null", but if not, i would not check anything like that.

CreateDatabase, OpenDatabaseConnection and CloseDatabaseConnection are public, and you use them in GetDirectoryContent... what would happen if someone creates a database an call your GetDirectoryContent? I would make those 3 methods private

First of all, I'd leave the SqlJetException unchecked and not catch it in close method. I hate exceptions in close methods because what am I supposed to do with it? If I could do anything, I've already caught it, but most times it has to be muted catch(xxxx) {}.

I never use printStackTrace.

Does the GetDirectoryContent method insert records? The name is not clear enough, it's supposed to get a directory content, not insert any content. And it returns nothing... I think a better name would be something like

saveContentFrom(String directory)

Is this class a public API? If so, I would check for errors like "this param is null".

CreateDatabase, OpenDatabaseConnection and CloseDatabaseConnection are public, and you use them in GetDirectoryContent... what would happen if someone creates a database and calls your GetDirectoryContent? I would make those 3 methods private.

Source Link

First of all, i'd do the SqlJetException unchecked and not catch it in close method. I hate exceptions in close methods because why do i suppose to do with it? If i could do anything, i've caught it, but most times i have to mute it "catch(xxxx) {}"

I never user printStackTrace.

Does GetDirectoryContent method insert records? The name is not clear enough, it supposes to get a directory content, not insert any content. And it returns nothing... I think it'd be a better name something like

saveContentFrom(String directory)

Is this class a public API? If so, I would check for errors like "this param is null", but if not, i would not check anything like that.

CreateDatabase, OpenDatabaseConnection and CloseDatabaseConnection are public, and you use them in GetDirectoryContent... what would happen if someone creates a database an call your GetDirectoryContent? I would make those 3 methods private