Skip to content

Reworked FileSystemProvider #557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Aug 11, 2025
Merged

Reworked FileSystemProvider #557

merged 11 commits into from
Aug 11, 2025

Conversation

petuch03
Copy link
Contributor

@petuch03 petuch03 commented Aug 7, 2025

Type of the change

  • New feature
  • Bug fix
  • Documentation fix
  • Tests improvement
  • Refactoring

Checklist for all pull requests

  • The pull request has a description of the proposed change
  • I read the Contributing Guidelines before opening the pull request
  • The pull request uses develop as the base branch
  • Tests for the changes have been added
  • All new and existing tests passed
Additional steps for pull requests adding a new feature
  • An issue describing the proposed change exists
  • The pull request includes a link to the issue
  • The change was discussed and approved in the issue
  • Docs have been added / updated

Copy link

github-actions bot commented Aug 7, 2025

Qodana for JVM

395 new problems were found

Inspection name Severity Problems
Check Kotlin and Java source code coverage 🔶 Warning 390
Vulnerable imported dependency 🔶 Warning 4
String concatenation that can be converted to string template ◽️ Notice 1
@@ Code coverage @@
+ 68% total lines covered
8868 lines analyzed, 6043 lines covered
# Calculated according to the filters of your coverage tool

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@@ -44,8 +44,18 @@ public object FileSystemProvider {
* @return The resolved path object.
* @throws IllegalArgumentException if [path] is an absolute path.
*/
@Deprecated("Use joinPath instead", ReplaceWith("joinPath(base, path)"))
public fun fromRelativeString(base: Path, path: String): Path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a quick look at its usage and don't see it anywhere (IJ, JVM), but maybe missed something. Why don't we just replace it right away?

@@ -134,8 +144,19 @@ public object FileSystemProvider {
* @throws IllegalArgumentException if the path doesn't exist or isn't a regular file.
* @throws IOException if an I/O error occurs during reading.
*/
@Deprecated("Use readBytes instead", ReplaceWith("readBytes(path)"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for this one. Here only the name has changed.

Copy link
Member

@sproshev sproshev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skarpovdev please let me know if you have more comments about the current state. If no, I'll remove deprecated methods

* @see [FileSystemProvider.ReadWrite.create]
*/
public suspend fun <Path> FileSystemProvider.ReadWrite<Path>.createFile(path: Path) {
create(path, FileMetadata.FileType.File)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: createFile() and createDirectory() can still throw IOException if the path already exists (originates from the 2-arg create). Might be worth adding that to their KDocs for clarity.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not put any details in this file intentionally and put see-references instead so there is no need to copy everything, let's see how it goes

@skarpovdev
Copy link
Contributor

skarpovdev commented Aug 11, 2025

@sproshev No more comments from me at this point, thanks for the quick fixes!

@sproshev sproshev merged commit 68d5962 into develop Aug 11, 2025
7 checks passed
@sproshev sproshev deleted the es/fs-reworked branch August 11, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants