0

I am exporting my data in form of zipping. I need to validate the version of my product, which version the file was exported. I have to validate the file version.

Is there any way in java that I can write/read the version of that file in File Detail as shown in below image?

enter image description here

try {
    Path inputFilePath = Paths.get(exportFilePath);
    Path outputFilePath = Paths.get(outputDirPath,
    String.format("%s.%s", inputFilePath.getFileName(), EXPORT_EXTENSION));
    fileZipper.zipIt(inputFilePath, outputFilePath);
    log.info("Zipping completed.");
} catch (IOException e) {
    log.error("Got error whlie zipping file. ", e);
}

Also please suggest me the other way to achieve this.

James Z
  • 12,209
  • 10
  • 24
  • 44
Mitul Maheshwari
  • 2,647
  • 4
  • 24
  • 38
  • 1
    From Java 7 on, it's easier to write custom file attributes. Take a look at [this](https://docs.oracle.com/javase/8/docs/api/java/nio/file/attribute/UserDefinedFileAttributeView.html). – Mena May 18 '18 at 10:22
  • 1
    What do you mean by validate the version? It looks like you're highlighting the archive bit in that image? – David Conrad May 18 '18 at 10:24
  • @DavidConrad I mean to say the version of a product or you can consider the product release version. This will be helpful to know which version of the zip is this. – Mitul Maheshwari May 18 '18 at 10:32
  • @Mena Let me look into this than – Mitul Maheshwari May 18 '18 at 10:32
  • How would you know the product release version from the zip? Your screenshot of file properties shows nothing like that. – James Z May 19 '18 at 09:00
  • @JamesZ yes, true. That's what my question is. I want to write the product release version in file details, so it will be visible under Details in windows system. – Mitul Maheshwari May 23 '18 at 10:17
  • I think you need to delete this question and ask a new one, with clear explanation of what you're actually doing, and what you have tried so far.. This one is totally confusing and probably that's why there's no answers either. – James Z May 23 '18 at 14:59

0 Answers0