CodeGym
AI Academy
Promotion
CodeGym University
Learning
Courses
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme

Lessons

  • Reviews
  • About us
Start
Start learning
Start learning now
  • My Progress
  • Courses
  • University
  • Quest Map
  • Lessons
  • File Organizer Project

    Kotlin SELF
    Level 46, Lesson 0
    We formalize the contract of the File Organizer console utility: which parameters the configuration accepts ( sourceDir, targetDir, allowedExt, dryRun), which modes are set type-safely via enum ( Mode, ConflictPolicy), how to normalize user input ( trim(), lowercase()), and how to do fail-fast validation via require() before any bulk disk operations. At the end, we outline the result model ( OpResult) and a main skeleton.
    Available
  • Directory traversal: walkTopDown, filters, and relative paths

    Kotlin SELF
    Level 46, Lesson 1
    We break down a safe “first stage” of File Organizer: how to traverse a directory tree via walkTopDown(), filter only files using isFile, carefully extract an extension via lastIndexOf, normalize and compare it with allowedExt, and then build a relative path inside the source using Path.relativize(...). At the end, we assemble the CandidateFile model and discuss typical mistakes.
    Available
  • Categories, target paths, and conflicts

    Kotlin SELF
    Level 46, Lesson 2
    We break down a “clean” file layout as a computation: how to determine a category by extension via enum class Category, how to safely assemble a target path with Path and resolve(), and how to reflect name conflicts in the plan in advance via PlanItem and PlannedConflict. At the end—practical nuances ( relativize(), checking startsWith()) and common mistakes.
    Available
  • Bulk operations engine: copy/move, partial failures, and results

    Kotlin SELF
    Level 46, Lesson 3
    We break down how to build a “bulk file operations engine” in Kotlin: we represent processing as a pipeline “plan → operation on a single file → result”, introduce the result model OpResult and statuses Status, learn to collect statistics via groupBy, correctly handle conflicts ( ConflictPolicy), and make processing resilient thanks to a narrow try/ catch at the level of a single item — including cases where renameTo() returns false without throwing an exception.
    Available
  • Safety and reporting

    Kotlin SELF
    Level 46, Lesson 4
    We break down how to make a file utility more reliable: we add a dry-run mode (planning without real filesystem changes), write a simple event log to a file using LocalDateTime, and generate the final report separately in memory and save it atomically via a temporary file and renameTo(). In practice, we assemble a single scenario with cfg.dryRun, OpResult results, and status grouping via groupBy.
    Available
Learn
  • Registration
  • Java Course
  • Help with Tasks
  • Pricing
  • Java Syntax
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success Stories
  • Activity
  • Affiliate Program
Company
  • About us
  • Contacts
  • Reviews
  • Press Room
  • CodeGym for EDU
  • FAQ
  • Support
CodeGym CodeGym is an online course for learning Java programming from scratch. This course is a perfect way to master Java for beginners. It contains 1200+ tasks with instant verification and an essential scope of Java fundamentals theory. To help you succeed in education, we’ve implemented a set of motivational features: quizzes, coding projects, content about efficient learning, and a Java developer’s career.
Follow us
Interface language
English
Deutsch Español हिन्दी Français Português Polski বাংলা 简体中文 मराठी தமிழ் Italiano Bahasa Indonesia 繁體中文 Nederlands 日本語 한국어 Bulgarian Danish Hungarian Basa Jawa Malay Norwegian Romanian Swedish Telugu Thai Українська Filipino Turkish Azərbaycan Русский Vietnamese
Programmers Are Made, Not Born © 2026 CodeGym
MastercardVisa
Programmers Are Made, Not Born © 2026 CodeGym