equal
deleted
inserted
replaced
83 synchronized RepositoryChunk newChunk(Instant timestamp) { |
83 synchronized RepositoryChunk newChunk(Instant timestamp) { |
84 try { |
84 try { |
85 if (!SecuritySupport.existDirectory(repository)) { |
85 if (!SecuritySupport.existDirectory(repository)) { |
86 this.repository = createRepository(baseLocation); |
86 this.repository = createRepository(baseLocation); |
87 jvm.setRepositoryLocation(repository.toString()); |
87 jvm.setRepositoryLocation(repository.toString()); |
|
88 SecuritySupport.setProperty(JFR_REPOSITORY_LOCATION_PROPERTY, repository.toString()); |
88 cleanupDirectories.add(repository); |
89 cleanupDirectories.add(repository); |
89 } |
90 } |
90 return new RepositoryChunk(repository, timestamp); |
91 return new RepositoryChunk(repository, timestamp); |
91 } catch (Exception e) { |
92 } catch (Exception e) { |
92 String errorMsg = String.format("Could not create chunk in repository %s, %s", repository, e.getMessage()); |
93 String errorMsg = String.format("Could not create chunk in repository %s, %s", repository, e.getMessage()); |
113 } |
114 } |
114 |
115 |
115 if (i == MAX_REPO_CREATION_RETRIES) { |
116 if (i == MAX_REPO_CREATION_RETRIES) { |
116 throw new IOException("Unable to create JFR repository directory using base location (" + basePath + ")"); |
117 throw new IOException("Unable to create JFR repository directory using base location (" + basePath + ")"); |
117 } |
118 } |
118 SafePath canonicalRepositoryPath = SecuritySupport.toRealPath(f); |
119 return SecuritySupport.toRealPath(f); |
119 SecuritySupport.setProperty(JFR_REPOSITORY_LOCATION_PROPERTY, canonicalRepositoryPath.toString()); |
|
120 return canonicalRepositoryPath; |
|
121 } |
120 } |
122 |
121 |
123 private static SafePath createRealBasePath(SafePath safePath) throws IOException { |
122 private static SafePath createRealBasePath(SafePath safePath) throws IOException { |
124 if (SecuritySupport.exists(safePath)) { |
123 if (SecuritySupport.exists(safePath)) { |
125 if (!SecuritySupport.isWritable(safePath)) { |
124 if (!SecuritySupport.isWritable(safePath)) { |